d3d11_shaders: add support for DXGI_FORMAT_AYUV rendering
authorSteve Lhomme <robux4@videolabs.io>
Mon, 4 Dec 2017 11:37:44 +0000 (12:37 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Mon, 28 May 2018 11:24:20 +0000 (13:24 +0200)
modules/video_chroma/dxgi_fmt.c
modules/video_chroma/dxgi_fmt.h
modules/video_output/win32/d3d11_shaders.c

index f2ef8e3..844e691 100644 (file)
@@ -79,6 +79,7 @@ static const d3d_format_t d3d_formats[] = {
 #endif
     { "I420",     DXGI_FORMAT_UNKNOWN,        VLC_CODEC_I420,          8, 2, 2, { DXGI_FORMAT_R8_UNORM,      DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
     { "I420_10",  DXGI_FORMAT_UNKNOWN,        VLC_CODEC_I420_10L,     10, 2, 2, { DXGI_FORMAT_R16_UNORM,     DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM } },
+    { "YUVA",     DXGI_FORMAT_UNKNOWN,        VLC_CODEC_YUVA,          8, 1, 1, { DXGI_FORMAT_R8_UNORM,      DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
     { "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA,          8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
     { "VA_BGRA",  DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_BGRA,  8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
     { "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA,          8, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
index d9fb8d7..6b5c32e 100644 (file)
@@ -36,7 +36,7 @@
 #define GPU_MANUFACTURER_S3            0x5333
 #define GPU_MANUFACTURER_QUALCOMM  0x4D4F4351
 
-#define D3D11_MAX_SHADER_VIEW  3
+#define D3D11_MAX_SHADER_VIEW  4
 
 typedef struct
 {
index 13f0cfd..b80a0fd 100644 (file)
@@ -226,6 +226,13 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
                 sample.z  = shaderTexture[0].Sample(samplerState, coords).a;\
                 sample.a  = 1;";
         break;
+    case DXGI_FORMAT_AYUV:
+        psz_sampler =
+                "sample.x  = shaderTexture[0].Sample(SampleType, In.Texture).z;\
+                sample.y  = shaderTexture[0].Sample(SampleType, In.Texture).y;\
+                sample.z  = shaderTexture[0].Sample(SampleType, In.Texture).x;\
+                sample.a  = shaderTexture[0].Sample(SampleType, In.Texture).a;";
+        break;
     case DXGI_FORMAT_R8G8B8A8_UNORM:
     case DXGI_FORMAT_B8G8R8A8_UNORM:
     case DXGI_FORMAT_B8G8R8X8_UNORM: