aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2018-02-25 08:51:09 +0100
committerRainer Hochecker <fernetmenta@online.de>2018-02-25 08:51:09 +0100
commit1a6981146aabbefe9237d443362789818c43b81c (patch)
treed5d282569ce40447e8d5e71696ba42bdadbce3eb /system
parent2129ff474fe9ff7cb15afe09ab7909a72e0787c2 (diff)
VideoPlayer: OpenGL - make sure rgb values are not neg after yuv2rgb conversion
Diffstat (limited to 'system')
-rw-r--r--system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl2
-rw-r--r--system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl2
2 files changed, 2 insertions, 2 deletions
diff --git a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
index 08d4f5e241..57c3a1760b 100644
--- a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
+++ b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
@@ -122,7 +122,7 @@ vec4 process()
#endif
#if defined(XBMC_COL_CONVERSION)
- rgb.rgb = pow(rgb.rgb, vec3(m_gammaSrc));
+ rgb.rgb = pow(max(vec3(0), rgb.rgb), vec3(m_gammaSrc));
rgb.rgb = max(vec3(0), m_primMat * rgb.rgb);
rgb.rgb = pow(rgb.rgb, vec3(m_gammaDstInv));
#endif
diff --git a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
index 48ce685e69..5bd2565ac2 100644
--- a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
+++ b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
@@ -93,7 +93,7 @@ vec4 process()
rgb.a = m_alpha;
#if defined(XBMC_COL_CONVERSION)
- rgb.rgb = pow(rgb.rgb, vec3(m_gammaSrc));
+ rgb.rgb = pow(max(vec3(0), rgb.rgb), vec3(m_gammaSrc));
rgb.rgb = max(vec3(0), m_primMat * rgb.rgb);
rgb.rgb = pow(rgb.rgb, vec3(m_gammaDstInv));