[vlc-commits] direct3d11: fix potential type mismatch when calling CreateShaderResourceView
Steve Lhomme
git at videolan.org
Thu Apr 13 16:47:28 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Mar 28 10:21:52 2017 +0200| [37b7af7e1511bee1476e80e01e24693c2efa3480] | committer: Jean-Baptiste Kempf
direct3d11: fix potential type mismatch when calling CreateShaderResourceView
If a texture has just one slice it is not considered a Texture2DArray
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=37b7af7e1511bee1476e80e01e24693c2efa3480
---
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 c5762f9c0b..2fad5f69c5 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;
More information about the vlc-commits
mailing list