[vlc-commits] direct3d11: don't use texture arrays in shader if we're using the staging texture

Steve Lhomme git at videolan.org
Wed Feb 10 11:07:01 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Feb  3 11:45:36 2021 +0100| [2ce05a626a0b9d311c705300d4513a5ed369b834] | committer: Steve Lhomme

direct3d11: don't use texture arrays in shader if we're using the staging texture

Only the decoder uses a texture array, everything else uses textures with one
slice.

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

 modules/video_output/win32/direct3d11.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index f41fd23f6d..76bd877423 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -317,7 +317,7 @@ static int UpdateStaging(vout_display_t *vd, const video_format_t *fmt)
 {
     vout_display_sys_t *sys = vd->sys;
 #ifdef HAVE_ID3D11VIDEODECODER
-    if (!is_d3d11_opaque(fmt->i_chroma) || sys->legacy_shader)
+    if (sys->legacy_shader)
     {
         /* we need a staging texture */
         ID3D11Texture2D *textures[DXGI_MAX_SHADER_VIEW] = {0};
@@ -598,7 +598,7 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
 
     /* Render the quad */
     ID3D11ShaderResourceView **renderSrc;
-    if (!is_d3d11_opaque(picture->format.i_chroma) || sys->legacy_shader)
+    if (sys->legacy_shader)
         renderSrc = sys->stagingSys.renderSrc;
     else {
         picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(picture);
@@ -1033,7 +1033,7 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
     HRESULT hr;
 
     sys->legacy_shader = sys->d3d_dev->feature_level < D3D_FEATURE_LEVEL_10_0 || !CanUseTextureArray(vd) ||
-            BogusZeroCopy(vd);
+            BogusZeroCopy(vd) || !is_d3d11_opaque(fmt->i_chroma);
 
     hr = D3D11_CompilePixelShader(vd, &sys->shaders, sys->d3d_dev, !sys->legacy_shader,
                                   &sys->display, false, fmt->transfer, fmt->primaries,



More information about the vlc-commits mailing list