[vlc-commits] d3d11_shaders: clip linear values

Steve Lhomme git at videolan.org
Wed Oct 17 16:07:51 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 12 15:56:07 2018 +0200| [1b9c58472e4711cce14ea2a53fb2ac1ccf812fcf] | committer: Steve Lhomme

d3d11_shaders: clip linear values

Converting BT2020 to BT709 can create colors outside of the possible range

(cherry picked from commit e06d0df978fc72927bb6a9285927d893556656ca)

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

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

diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 8b9d197416..306a9fe01d 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -98,6 +98,7 @@ static const char* globPixelShaderDefault = "\
   }\n\
   \n\
   inline float3 linearToDisplay(float3 rgb) {\n\
+     rgb = max(min(rgb, 1), 0);\n\
       %s;\n\
   }\n\
   \n\



More information about the vlc-commits mailing list