[vlc-commits] direct3d11: support rendering from Y410 (4:4:4 10 bit) to RGB

Steve Lhomme git at videolan.org
Fri Mar 13 10:28:47 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 13 08:10:48 2020 +0100| [62c0ea9ab74a3a61c04a146cc3f53c951f2f0627] | committer: Steve Lhomme

direct3d11: support rendering from Y410 (4:4:4 10 bit) to RGB

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

 modules/video_output/win32/d3d11_quad.c    |  1 +
 modules/video_output/win32/d3d11_shaders.c | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index a286b4b5b8..8ec8f16e27 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -1090,6 +1090,7 @@ void D3D11_UpdateViewport(d3d_quad_t *quad, const RECT *rect, const d3d_format_t
     case DXGI_FORMAT_YUY2:
     case DXGI_FORMAT_AYUV:
     case DXGI_FORMAT_Y210:
+    case DXGI_FORMAT_Y410:
         if ( display->formatTexture == DXGI_FORMAT_NV12 ||
              display->formatTexture == DXGI_FORMAT_P010 )
         {
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 6dfbc27163..8f718b933c 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -205,6 +205,7 @@ bool IsRGBShader(const d3d_format_t *cfg)
            cfg->formatTexture != DXGI_FORMAT_YUY2 &&
            cfg->formatTexture != DXGI_FORMAT_AYUV &&
            cfg->formatTexture != DXGI_FORMAT_Y210 &&
+           cfg->formatTexture != DXGI_FORMAT_Y410 &&
            cfg->formatTexture != DXGI_FORMAT_420_OPAQUE;
 }
 
@@ -384,6 +385,13 @@ HRESULT (D3D11_CompilePixelShader)(vlc_object_t *o, const d3d11_shaders_t *shade
                     "sample.z  = shaderTexture[0].Sample(samplerState, coords).a;\n"
                     "sample.a  = 1;";
             break;
+        case DXGI_FORMAT_Y410:
+            psz_sampler[0] =
+                    "sample.x  = shaderTexture[0].Sample(samplerState, coords).g;\n"
+                    "sample.y  = shaderTexture[0].Sample(samplerState, coords).r;\n"
+                    "sample.z  = shaderTexture[0].Sample(samplerState, coords).b;\n"
+                    "sample.a  = 1;";
+            break;
         case DXGI_FORMAT_AYUV:
             psz_sampler[0] =
                     "sample.x  = shaderTexture[0].Sample(samplerState, coords).z;\n"
@@ -763,6 +771,9 @@ void D3D11_ClearRenderTargets(d3d11_device_t *d3d_dev, const d3d_format_t *cfg,
     case DXGI_FORMAT_YUY2:
         ID3D11DeviceContext_ClearRenderTargetView( d3d_dev->d3dcontext, targets[0], blackYUY2);
         break;
+    case DXGI_FORMAT_Y410:
+        ID3D11DeviceContext_ClearRenderTargetView( d3d_dev->d3dcontext, targets[0], blackVUYA);
+        break;
     case DXGI_FORMAT_Y210:
         ID3D11DeviceContext_ClearRenderTargetView( d3d_dev->d3dcontext, targets[0], blackY210);
         break;



More information about the vlc-commits mailing list