renderer: fix non shader cm reset (#13027)
This commit is contained in:
parent
441a8714c7
commit
55f40ecc95
2 changed files with 15 additions and 10 deletions
|
|
@ -1812,8 +1812,11 @@ uint16_t CMonitor::isDSBlocked(bool full) {
|
||||||
return reasons;
|
return reasons;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool surfaceIsHDR = PSURFACE->m_colorManagement.valid() && (PSURFACE->m_colorManagement->isHDR() || PSURFACE->m_colorManagement->isWindowsScRGB());
|
const bool surfaceIsHDR = PSURFACE->m_colorManagement.valid() && PSURFACE->m_colorManagement->isHDR();
|
||||||
if (needsCM() && *PNONSHADER != CM_NS_IGNORE && !canNoShaderCM() && ((inHDR() && (*PPASS == 0 || !surfaceIsHDR)) || (!inHDR() && (*PPASS != 1 || surfaceIsHDR))))
|
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;
|
reasons |= DS_BLOCK_CM;
|
||||||
|
|
||||||
return reasons;
|
return reasons;
|
||||||
|
|
@ -2131,13 +2134,15 @@ bool CMonitor::canNoShaderCM() {
|
||||||
|
|
||||||
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
|
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
|
||||||
// only primaries differ
|
// only primaries differ
|
||||||
return ((SRC_DESC_VALUE.transferFunction == m_imageDescription->value().transferFunction ||
|
return (
|
||||||
|
(SRC_DESC_VALUE.transferFunction == m_imageDescription->value().transferFunction ||
|
||||||
(*PSDREOTF == 2 && SRC_DESC_VALUE.transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_SRGB &&
|
(*PSDREOTF == 2 && SRC_DESC_VALUE.transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_SRGB &&
|
||||||
m_imageDescription->value().transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22)) &&
|
m_imageDescription->value().transferFunction == NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22)) &&
|
||||||
SRC_DESC_VALUE.transferFunctionPower == m_imageDescription->value().transferFunctionPower &&
|
SRC_DESC_VALUE.transferFunctionPower == m_imageDescription->value().transferFunctionPower &&
|
||||||
(!inHDR() || SRC_DESC_VALUE.luminances == m_imageDescription->value().luminances) &&
|
(!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 &&
|
// not used by shaders atm
|
||||||
SRC_DESC_VALUE.maxFALL == m_imageDescription->value().maxFALL);
|
// && 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() {
|
bool CMonitor::doesNoShaderCM() {
|
||||||
|
|
|
||||||
|
|
@ -1646,7 +1646,7 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
|
||||||
if (*PCT)
|
if (*PCT)
|
||||||
pMonitor->m_output->state->setContentType(NContentType::toDRM(FS_WINDOW ? FS_WINDOW->getContentType() : CONTENT_TYPE_NONE));
|
pMonitor->m_output->state->setContentType(NContentType::toDRM(FS_WINDOW ? FS_WINDOW->getContentType() : CONTENT_TYPE_NONE));
|
||||||
|
|
||||||
if (FS_WINDOW != pMonitor->m_previousFSWindow) {
|
if (FS_WINDOW != pMonitor->m_previousFSWindow || (!FS_WINDOW && pMonitor->m_noShaderCTM)) {
|
||||||
if (*PNONSHADER == CM_NS_IGNORE || !FS_WINDOW || !pMonitor->needsCM() || !pMonitor->canNoShaderCM() ||
|
if (*PNONSHADER == CM_NS_IGNORE || !FS_WINDOW || !pMonitor->needsCM() || !pMonitor->canNoShaderCM() ||
|
||||||
(*PNONSHADER == CM_NS_ONDEMAND && pMonitor->m_lastScanout.expired() && *PPASS != 1)) {
|
(*PNONSHADER == CM_NS_ONDEMAND && pMonitor->m_lastScanout.expired() && *PPASS != 1)) {
|
||||||
if (pMonitor->m_noShaderCTM) {
|
if (pMonitor->m_noShaderCTM) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue