renderer: fix cm_fs_passthrough (#9698)

This commit is contained in:
UjinT34
2025-03-22 20:34:01 +03:00
committed by GitHub
parent 6384f4acf4
commit 6ab5a0befb
4 changed files with 14 additions and 11 deletions

View File

@@ -1379,13 +1379,15 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, const CB
glTexParameteri(tex->m_iTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
const bool SURFACE_HAS_CM = m_RenderData.surface && m_RenderData.surface->colorManagement && m_RenderData.surface->colorManagement->hasImageDescription();
const auto imageDescription =
m_RenderData.surface.valid() && m_RenderData.surface->colorManagement.valid() ? m_RenderData.surface->colorManagement->imageDescription() : SImageDescription{};
const bool skipCM = !*PENABLECM /* CM disabled by the user */
|| !m_RenderData.surface /* No surface - no point in CM */
|| !m_bCMSupported /* CM unsupported - hw failed to compile the shader probably */
|| (!SURFACE_HAS_CM && m_RenderData.pMonitor->imageDescription == SImageDescription{}) /* Surface doesn't have CM and monitor isn't CM'd */
|| (*PPASS && m_RenderData.pMonitor->activeWorkspace && m_RenderData.pMonitor->activeWorkspace->m_bHasFullscreenWindow &&
const bool skipCM = !*PENABLECM /* CM disabled by the user */
|| !m_RenderData.surface /* No surface - no point in CM */
|| !m_bCMSupported /* CM unsupported - hw failed to compile the shader probably */
|| (imageDescription == m_RenderData.pMonitor->imageDescription) /* Source and target have the same image description */
|| ((*PPASS == 1 || (*PPASS == 2 && imageDescription.transferFunction == CM_TRANSFER_FUNCTION_ST2084_PQ)) && m_RenderData.pMonitor->activeWorkspace &&
m_RenderData.pMonitor->activeWorkspace->m_bHasFullscreenWindow &&
m_RenderData.pMonitor->activeWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN) /* Fullscreen window with pass cm enabled */;
glUseProgram(shader->program);