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

Steve Lhomme git at videolan.org
Wed Mar 21 15:08:08 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 21 09:51:55 2018 +0100| [73ff958b52d317fcd7db3af8cf158127e75f1820] | committer: Hugo Beauzée-Luyssen

direct3d11: only allocate the large texture array when needed

(cherry picked from commit a74ef553215eb4a54b0d958104a880034c77a236)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 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 9bf9e56bd8..2e62f22b64 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