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

Steve Lhomme git at videolan.org
Mon Nov 5 10:13:11 CET 2018


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

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

(cherry picked from commit fce5fafb54e3ee4a320a00d8c68a55b45d7710a3)

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

 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 2b2e6be0c5..5e271ef827 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -354,7 +354,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