diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2025-06-15 13:15:18 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-15 12:15:18 +0200 |
| commit | c3894d9288e99500df4fc4704bcc614ea8d520ec (patch) | |
| tree | 083ac23210b978f554e3a42aa6fc618e4a861d9e /src/render/OpenGL.cpp | |
| parent | 3db3baa19e55a039c1a64a29c8e9aaadea4e5f01 (diff) | |
config/monitor: Add monitor v2 HDR rules (#10623)
Diffstat (limited to 'src/render/OpenGL.cpp')
| -rw-r--r-- | src/render/OpenGL.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 7ba4b6b9..659bc1da 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1436,7 +1436,7 @@ void CHyprOpenGLImpl::renderTextureWithDamage(SP<CTexture> tex, const CBox& box, static std::map<std::pair<uint32_t, uint32_t>, std::array<GLfloat, 9>> primariesConversionCache; void CHyprOpenGLImpl::passCMUniforms(const SShader& shader, const NColorManagement::SImageDescription& imageDescription, - const NColorManagement::SImageDescription& targetImageDescription, bool modifySDR) { + const NColorManagement::SImageDescription& targetImageDescription, bool modifySDR, float sdrMinLuminance, int sdrMaxLuminance) { glUniform1i(shader.sourceTF, imageDescription.transferFunction); glUniform1i(shader.targetTF, targetImageDescription.transferFunction); @@ -1450,8 +1450,8 @@ void CHyprOpenGLImpl::passCMUniforms(const SShader& shader, const NColorManageme }; glUniformMatrix4x2fv(shader.targetPrimaries, 1, false, glTargetPrimaries); - glUniform2f(shader.srcTFRange, imageDescription.getTFMinLuminance(), imageDescription.getTFMaxLuminance()); - glUniform2f(shader.dstTFRange, targetImageDescription.getTFMinLuminance(), targetImageDescription.getTFMaxLuminance()); + glUniform2f(shader.srcTFRange, imageDescription.getTFMinLuminance(sdrMinLuminance), imageDescription.getTFMaxLuminance(sdrMaxLuminance)); + glUniform2f(shader.dstTFRange, targetImageDescription.getTFMinLuminance(sdrMinLuminance), targetImageDescription.getTFMaxLuminance(sdrMaxLuminance)); const float maxLuminance = imageDescription.luminances.max > 0 ? imageDescription.luminances.max : imageDescription.luminances.reference; glUniform1f(shader.maxLuminance, maxLuminance * targetImageDescription.luminances.reference / imageDescription.luminances.reference); @@ -1480,7 +1480,7 @@ void CHyprOpenGLImpl::passCMUniforms(const SShader& shader, const NColorManageme } void CHyprOpenGLImpl::passCMUniforms(const SShader& shader, const SImageDescription& imageDescription) { - passCMUniforms(shader, imageDescription, m_renderData.pMonitor->m_imageDescription, true); + passCMUniforms(shader, imageDescription, m_renderData.pMonitor->m_imageDescription, true, m_renderData.pMonitor->m_sdrMinLuminance, m_renderData.pMonitor->m_sdrMaxLuminance); } void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, const CBox& box, float alpha, const CRegion& damage, int round, float roundingPower, bool discardActive, |
