summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-08-29 14:31:07 +0300
committerGitHub <noreply@github.com>2025-08-29 13:31:07 +0200
commit05a1c0aa7395d19213e587c83089ecbd7b92085c (patch)
tree32a26c919feddafaf9e91c1c6274515622be39d3 /src/render/OpenGL.cpp
parent790e544689e7f7a906ee291a6715bc6833b15606 (diff)
renderer: Fix CM for DS and SDR passthrough (#11503)
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index f4599a84..0780adf9 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1597,17 +1597,17 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
- const bool canPassHDRSurface = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ?
- m_renderData.surface->m_colorManagement->isHDR() && !m_renderData.surface->m_colorManagement->isWindowsScRGB() :
- false; // windows scRGB requires CM shader
- auto imageDescription = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ?
- m_renderData.surface->m_colorManagement->imageDescription() :
- (data.cmBackToSRGB ? data.cmBackToSRGBSource->m_imageDescription : SImageDescription{});
+ const bool isHDRSurface = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ? m_renderData.surface->m_colorManagement->isHDR() : false;
+ const bool canPassHDRSurface = isHDRSurface && !m_renderData.surface->m_colorManagement->isWindowsScRGB(); // windows scRGB requires CM shader
+
+ auto imageDescription = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ?
+ m_renderData.surface->m_colorManagement->imageDescription() :
+ (data.cmBackToSRGB ? data.cmBackToSRGBSource->m_imageDescription : SImageDescription{});
const bool skipCM = !*PENABLECM || !m_cmSupported /* CM unsupported or disabled */
+ || m_renderData.pMonitor->doesNoShaderCM() /* no shader needed */
|| (imageDescription == m_renderData.pMonitor->m_imageDescription && !data.cmBackToSRGB) /* Source and target have the same image description */
- || ((*PPASS == 1 || (*PPASS == 2 && canPassHDRSurface)) && m_renderData.pMonitor->m_activeWorkspace && m_renderData.pMonitor->m_activeWorkspace->m_hasFullscreenWindow &&
- m_renderData.pMonitor->m_activeWorkspace->m_fullscreenMode == FSMODE_FULLSCREEN) /* Fullscreen window with pass cm enabled */;
+ || (((*PPASS && canPassHDRSurface) || (*PPASS == 1 && !isHDRSurface)) && m_renderData.pMonitor->inFullscreenMode()) /* Fullscreen window with pass cm enabled */;
if (!skipCM && !usingFinalShader && (texType == TEXTURE_RGBA || texType == TEXTURE_RGBX))
shader = &m_shaders->m_shCM;