[vlc-commits] d3d11_shaders: add support for DXGI_FORMAT_AYUV rendering

Steve Lhomme git at videolan.org
Mon May 28 13:25:24 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Dec  4 12:37:44 2017 +0100| [ce51968ce07b52d32a7a1ff6ccdcf821cfefc058] | committer: Steve Lhomme

d3d11_shaders: add support for DXGI_FORMAT_AYUV rendering

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

 modules/video_chroma/dxgi_fmt.c            | 1 +
 modules/video_chroma/dxgi_fmt.h            | 2 +-
 modules/video_output/win32/d3d11_shaders.c | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/dxgi_fmt.c b/modules/video_chroma/dxgi_fmt.c
index f2ef8e35f2..844e691631 100644
--- a/modules/video_chroma/dxgi_fmt.c
+++ b/modules/video_chroma/dxgi_fmt.c
@@ -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 } },
diff --git a/modules/video_chroma/dxgi_fmt.h b/modules/video_chroma/dxgi_fmt.h
index d9fb8d7ad5..6b5c32e96a 100644
--- a/modules/video_chroma/dxgi_fmt.h
+++ b/modules/video_chroma/dxgi_fmt.h
@@ -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
 {
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 13f0cfdb9e..b80a0fd97b 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -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:



More information about the vlc-commits mailing list