[vlc-devel] [PATCH] direct3d11: fix potential type mismatch when calling CreateShaderResourceView

Steve Lhomme robux4 at videolabs.io
Tue Mar 28 10:21:52 CEST 2017


If a texture has just one slice it is not considered a Texture2DArray
---
 modules/video_output/win32/direct3d11.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index f8f5b3710b..57bf6331d5 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -613,8 +613,10 @@ static int AllocateShaderView(vout_display_t *vd, const d3d_format_t *format,
     vout_display_sys_t *sys = vd->sys;
     int i;
     D3D11_SHADER_RESOURCE_VIEW_DESC resviewDesc = { 0 };
+    D3D11_TEXTURE2D_DESC texDesc;
+    ID3D11Texture2D_GetDesc(picsys->texture[0], &texDesc);
 
-    if (sys->legacy_shader)
+    if (texDesc.ArraySize == 1)
     {
         resviewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
         resviewDesc.Texture2D.MipLevels = 1;
-- 
2.11.1



More information about the vlc-devel mailing list