cm: follow preferred srgb eotf for screencopy (#12230)

This commit is contained in:
Dominick DiMaggio 2025-11-07 09:02:26 -05:00 committed by GitHub
parent 1ca6058bda
commit 3fc8cb828c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1711,7 +1711,9 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c
// revert luma changes to avoid black screenshots.
// this will likely not be 1:1, and might cause screenshots to be too bright, but it's better than pitch black.
imageDescription.luminances = {};
passCMUniforms(*shader, imageDescription, NColorManagement::SImageDescription{}, true, -1, -1);
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
auto chosenSdrEotf = *PSDREOTF > 0 ? NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22 : NColorManagement::CM_TRANSFER_FUNCTION_SRGB;
passCMUniforms(*shader, imageDescription, NColorManagement::SImageDescription{.transferFunction = chosenSdrEotf}, true, -1, -1);
} else
passCMUniforms(*shader, imageDescription);
}