render/cm: add ICC profile pipeline (#12711)

Adds an ICC profile pipeline, loading via config and applying via 3D LUTs.
This commit is contained in:
Vaxry 2026-03-04 19:50:28 +00:00 committed by GitHub
parent 8271cfc97b
commit 10754745a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 984 additions and 373 deletions

View file

@ -159,9 +159,11 @@ void CScreenshareFrame::renderMonitor() {
const auto PMONITOR = m_session->monitor();
auto TEXTURE = makeShared<CTexture>(PMONITOR->m_output->state->state().buffer);
if (!g_pHyprOpenGL->m_monitorRenderResources.contains(PMONITOR))
return; // wtf?
auto TEXTURE = g_pHyprOpenGL->m_monitorRenderResources[PMONITOR].monitorMirrorFB.getTexture();
const bool IS_CM_AWARE = PROTO::colorManagement && PROTO::colorManagement->isClientCMAware(m_session->m_client);
g_pHyprOpenGL->m_renderData.transformDamage = false;
g_pHyprOpenGL->m_renderData.noSimplify = true;
@ -171,11 +173,7 @@ void CScreenshareFrame::renderMonitor() {
.translate(-m_session->m_captureBox.pos()); // vvvv kinda ass-backwards but that's how I designed the renderer... sigh.
g_pHyprOpenGL->pushMonitorTransformEnabled(true);
g_pHyprOpenGL->setRenderModifEnabled(false);
g_pHyprOpenGL->renderTexture(TEXTURE, monbox,
{
.cmBackToSRGB = !IS_CM_AWARE,
.cmBackToSRGBSource = !IS_CM_AWARE ? PMONITOR : nullptr,
});
g_pHyprOpenGL->renderTexturePrimitive(TEXTURE, monbox);
g_pHyprOpenGL->setRenderModifEnabled(true);
g_pHyprOpenGL->popMonitorTransformEnabled();