[vlc-commits] direct3d11: only allocate the large texture array when needed

Steve Lhomme git at videolan.org
Wed Mar 21 11:17:07 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 21 09:51:55 2018 +0100| [a74ef553215eb4a54b0d958104a880034c77a236] | committer: Steve Lhomme

direct3d11: only allocate the large texture array when needed

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d5457b7110..55d918a4b7 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -565,13 +565,10 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
     pool_size += 2;
 
     vout_display_sys_t *sys = vd->sys;
-    ID3D11Texture2D  *textures[pool_size * D3D11_MAX_SHADER_VIEW];
     picture_t **pictures = NULL;
     picture_t *picture;
     unsigned  picture_count = 0;
 
-    memset(textures, 0, sizeof(textures));
-
     if (sys->sys.pool)
         return sys->sys.pool;
 
@@ -603,6 +600,8 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         sys->sys.pool = picture_pool_NewFromFormat( &surface_fmt, pool_size );
     else
     {
+        ID3D11Texture2D  *textures[pool_size * D3D11_MAX_SHADER_VIEW];
+        memset(textures, 0, sizeof(textures));
         unsigned slices = pool_size;
         if (!CanUseVoutPool(&sys->d3d_dev, pool_size))
             /* only provide enough for the filters, we can still do direct rendering */



More information about the vlc-commits mailing list