summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2026-01-21 17:03:37 +0300
committerGitHub <noreply@github.com>2026-01-21 14:03:37 +0000
commit55f40ecc9572b55319f5af3ad947476b4fe9ce2f (patch)
tree923f406a2203cb70b5cc891f4dcd610c06bd0304 /src/helpers/Monitor.cpp
parent441a8714c75a44d1916f03c684e3389c69367fcb (diff)
renderer: fix non shader cm reset (#13027)
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index c042fe77..cee9ff1b 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -1812,8 +1812,11 @@ uint16_t CMonitor::isDSBlocked(bool full) {
return reasons;
}
- const bool surfaceIsHDR = PSURFACE->m_colorManagement.valid() && (PSURFACE->m_colorManagement->isHDR() || PSURFACE->m_colorManagement->isWindowsScRGB());
- if (needsCM() && *PNONSHADER != CM_NS_IGNORE && !canNoShaderCM() && ((inHDR() && (*PPASS == 0 || !surfaceIsHDR)) || (!inHDR() && (*PPASS != 1 || surfaceIsHDR))))
+ const bool surfaceIsHDR = PSURFACE->m_colorManagement.valid() && PSURFACE->m_colorManagement->isHDR();
+ const bool surfaceIsScRGB = surfaceIsHDR && PSURFACE->m_colorManagement->isWindowsScRGB();
+
+ if (needsCM() && (*PNONSHADER != CM_NS_IGNORE || surfaceIsScRGB) && !canNoShaderCM() &&
+ ((inHDR() && (*PPASS == 0 || !surfaceIsHDR)) || (!inHDR() && (*PPASS != 1 || surfaceIsHDR))))
reasons |= DS_BLOCK_CM;
return reasons;
@@ -2131,13 +2134,15 @@ bool CMonitor::canNoShaderCM() {
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
// only primaries differ
- return ((SRC_DESC_VALUE.transferFunction == m_imageDescription->value().transferFunction ||
- (*PSDREOTF == 2 && SRC_DESC_VALUE.transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_SRGB &&
- m_imageDescription->value().transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22)) &&
- SRC_DESC_VALUE.transferFunctionPower == m_imageDescription->value().transferFunctionPower &&
- (!inHDR() || SRC_DESC_VALUE.luminances == m_imageDescription->value().luminances) &&
- SRC_DESC_VALUE.masteringLuminances == m_imageDescription->value().masteringLuminances && SRC_DESC_VALUE.maxCLL == m_imageDescription->value().maxCLL &&
- SRC_DESC_VALUE.maxFALL == m_imageDescription->value().maxFALL);
+ return (
+ (SRC_DESC_VALUE.transferFunction == m_imageDescription->value().transferFunction ||
+ (*PSDREOTF == 2 && SRC_DESC_VALUE.transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_SRGB &&
+ m_imageDescription->value().transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22)) &&
+ SRC_DESC_VALUE.transferFunctionPower == m_imageDescription->value().transferFunctionPower &&
+ (!inHDR() || SRC_DESC_VALUE.luminances == m_imageDescription->value().luminances)
+ // not used by shaders atm
+ // && SRC_DESC_VALUE.masteringLuminances == m_imageDescription->value().masteringLuminances && SRC_DESC_VALUE.maxCLL == m_imageDescription->value().maxCLL && SRC_DESC_VALUE.maxFALL == m_imageDescription->value().maxFALL
+ );
}
bool CMonitor::doesNoShaderCM() {