summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorDominick DiMaggio <ddimaggio324@gmail.com>2025-11-07 09:02:26 -0500
committerGitHub <noreply@github.com>2025-11-07 14:02:26 +0000
commit3fc8cb828c0adf2c5f1a499f13ab922f36b86d08 (patch)
tree06b65dad94a271d8654db79fea8aa7969c6746ea /src/render/OpenGL.cpp
parent1ca6058bda89291241b5ed4b1d8784094a21a556 (diff)
cm: follow preferred srgb eotf for screencopy (#12230)
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 02da142f..baf69b96 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -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);
}