[vlc-commits] d3d11: don't use the primary conversion for unknown primaries

Steve Lhomme git at videolan.org
Mon Nov 5 10:09:07 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov  5 10:08:19 2018 +0100| [fce5fafb54e3ee4a320a00d8c68a55b45d7710a3] | committer: Steve Lhomme

d3d11: don't use the primary conversion for unknown primaries

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

 modules/video_output/win32/d3d11_shaders.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 29a1e35738..b76e5751d2 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -512,7 +512,22 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
     }
 
     if (display->colorspace->primaries != primaries)
-        psz_primaries_transform = "return max(mul(rgb, Primaries), 0)";
+    {
+        switch (primaries)
+        {
+        case COLOR_PRIMARIES_BT601_525:
+        case COLOR_PRIMARIES_BT601_625:
+        case COLOR_PRIMARIES_BT709:
+        case COLOR_PRIMARIES_BT2020:
+        case COLOR_PRIMARIES_DCI_P3:
+        case COLOR_PRIMARIES_FCC1953:
+            psz_primaries_transform = "return max(mul(rgb, Primaries), 0)";
+            break;
+        default:
+            /* see STANDARD_PRIMARIES */
+            msg_Warn(o, "unhandled color primaries %d", primaries);
+        }
+    }
 
     int range_adjust = 0;
     if (display->colorspace->b_full_range) {



More information about the vlc-commits mailing list