[vlc-commits] d3d11: pass the source primaries when compiling the shaders

Steve Lhomme git at videolan.org
Fri Oct 12 16:04:56 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 12 14:55:17 2018 +0200| [a6804a21ab30e8cbf3eb72916262bd6f35e491cf] | committer: Steve Lhomme

d3d11: pass the source primaries when compiling the shaders

the display_info_t already has the destination primaries

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

 modules/video_output/win32/d3d11_shaders.c | 3 ++-
 modules/video_output/win32/d3d11_shaders.h | 7 ++++---
 modules/video_output/win32/direct3d11.c    | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index e54512b9b0..647d612f6f 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -258,7 +258,8 @@ static HRESULT CompileTargetShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool l
 HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool legacy_shader,
                                  d3d11_device_t *d3d_dev,
                                  const display_info_t *display,
-                                 video_transfer_func_t transfer, bool src_full_range,
+                                 video_transfer_func_t transfer,
+                                 video_color_primaries_t primaries, bool src_full_range,
                                  d3d_quad_t *quad)
 {
     static const char *DEFAULT_NOOP = "return rgb";
diff --git a/modules/video_output/win32/d3d11_shaders.h b/modules/video_output/win32/d3d11_shaders.h
index 99d15cc67c..ca2a6ac379 100644
--- a/modules/video_output/win32/d3d11_shaders.h
+++ b/modules/video_output/win32/d3d11_shaders.h
@@ -115,10 +115,11 @@ bool IsRGBShader(const d3d_format_t *);
 
 HRESULT D3D11_CompilePixelShader(vlc_object_t *, d3d11_handle_t *, bool legacy_shader,
                                  d3d11_device_t *, const display_info_t *,
-                                 video_transfer_func_t, bool src_full_range,
+                                 video_transfer_func_t, video_color_primaries_t,
+                                 bool src_full_range,
                                  d3d_quad_t *);
-#define D3D11_CompilePixelShader(a,b,c,d,e,f,g,h) \
-    D3D11_CompilePixelShader(VLC_OBJECT(a),b,c,d,e,f,g,h)
+#define D3D11_CompilePixelShader(a,b,c,d,e,f,g,h,i) \
+    D3D11_CompilePixelShader(VLC_OBJECT(a),b,c,d,e,f,g,h,i)
 void D3D11_ReleasePixelShader(d3d_quad_t *);
 
 HRESULT D3D11_CompileFlatVertexShader(vlc_object_t *, d3d11_handle_t *, d3d11_device_t *, d3d_vshader_t *);
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 772754107f..e33ebee682 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1416,7 +1416,8 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
     sys->legacy_shader = sys->d3d_dev.feature_level < D3D_FEATURE_LEVEL_10_0 || !CanUseTextureArray(vd);
 
     hr = D3D11_CompilePixelShader(vd, &sys->hd3d, sys->legacy_shader, &sys->d3d_dev,
-                                  &sys->display, fmt->transfer, fmt->b_color_range_full,
+                                  &sys->display, fmt->transfer, fmt->primaries,
+                                  fmt->b_color_range_full,
                                   &sys->picQuad);
     if (FAILED(hr))
     {
@@ -1523,7 +1524,7 @@ static int Direct3D11CreateGenericResources(vout_display_t *vd)
     if (sys->regionQuad.textureFormat != NULL)
     {
         hr = D3D11_CompilePixelShader(vd, &sys->hd3d, sys->legacy_shader, &sys->d3d_dev,
-                                      &sys->display, TRANSFER_FUNC_SRGB, true,
+                                      &sys->display, TRANSFER_FUNC_SRGB, COLOR_PRIMARIES_SRGB, true,
                                       &sys->regionQuad);
         if (FAILED(hr))
         {



More information about the vlc-commits mailing list