[vlc-commits] d3d11_shaders: don't output negative colors after chroma conversion to RGB

Steve Lhomme git at videolan.org
Mon Dec 17 16:46:27 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Dec 17 09:29:40 2018 +0100| [8216306e91a5834eb67263a9a12290ed441b3631] | committer: Steve Lhomme

d3d11_shaders: don't output negative colors after chroma conversion to RGB

Fixes #21349

(cherry picked from commit be03a7a02506b551b301e3c1e173b7cf222fe080)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8216306e91a5834eb67263a9a12290ed441b3631
---

 modules/video_output/win32/d3d11_shaders.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 5e271ef827..8bea3a7817 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -127,7 +127,7 @@ static const char* globPixelShaderDefault = "\
         sample = sampleTexture( SamplerStates[1], In.Texture );\n\
     else\n\
         sample = sampleTexture( SamplerStates[0], In.Texture );\n\
-    float4 rgba = mul(mul(sample, WhitePoint), Colorspace);\n\
+    float4 rgba = max(mul(mul(sample, WhitePoint), Colorspace),0);\n\
     float opacity = rgba.a * Opacity;\n\
     float4 rgb = rgba; rgb.a = 0;\n\
     rgb = sourceToLinear(rgb);\n\



More information about the vlc-commits mailing list