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

Steve Lhomme git at videolan.org
Mon Dec 17 16:44:39 CET 2018


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

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

Fixes #21349

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

 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 b76e5751d2..c10b2f1ee2 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -131,7 +131,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