renderer: Simplify and fix hdr metadata setting (#9706)

* simplify and fix hdr metadata setting

* keep incorrect(?) cm skip till #9600
This commit is contained in:
UjinT34 2025-03-24 15:56:07 +03:00 committed by GitHub
parent e4abf26069
commit a852461c7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 14 deletions

View file

@ -1382,9 +1382,9 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, const CB
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 */
const bool skipCM = !*PENABLECM /* CM disabled by the user */
|| !m_RenderData.surface /* FIXME unknown texture settings should be treated as sRGB and go through CM if monitor isn't in sRGB mode */
|| !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 &&