summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video_shaders.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_video_shaders.glsl')
-rw-r--r--video/out/gl_video_shaders.glsl5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl
index 11d2e94a61..bb6530295f 100644
--- a/video/out/gl_video_shaders.glsl
+++ b/video/out/gl_video_shaders.glsl
@@ -419,8 +419,9 @@ void main() {
lessThanEqual(color.br, vec2(0))) + color.gg;
#endif
#ifdef USE_COLORMATRIX
- // Clamp down here to avoid clipping CbCr details before CONST_LUMA
- // has a chance to convert them.
+ // CONST_LUMA involves numbers outside the [0,1] range so we make sure
+ // to clip here, after the (possible) USE_CONST_LUMA calculations are done,
+ // instead of immediately after the colormatrix conversion.
color = clamp(color, 0, 1);
#endif
// If we are scaling in linear light (SRGB or 3DLUT option enabled), we