[vlc-commits] direct3d11: reorder the pool allocation code

Steve Lhomme git at videolan.org
Mon Feb 12 17:14:27 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 12 14:25:17 2018 +0100| [ab3f3d4f8df0c50a6768b9bbf8990a669e17faf9] | committer: Steve Lhomme

direct3d11: reorder the pool allocation code

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

 modules/video_output/win32/direct3d11.c | 39 +++++++++++++++------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 449d776d18..4b76d13cf4 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -586,6 +586,13 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
     surface_fmt.i_width  = sys->picQuad.i_width;
     surface_fmt.i_height = sys->picQuad.i_height;
 
+    if (SetupQuad( vd, &surface_fmt, &sys->picQuad, &sys->sys.rect_src_clipped,
+                   sys->picQuadConfig, sys->picQuadPixelShader,
+                   surface_fmt.projection_mode, vd->fmt.orientation ) != VLC_SUCCESS) {
+        msg_Err(vd, "Could not Create the main quad picture.");
+        return NULL;
+    }
+
     if (!vd->info.is_slow) {
         HRESULT           hr;
         ID3D10Multithread *pMultithread;
@@ -596,7 +603,9 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         }
     }
 
-    if (sys->picQuadConfig->formatTexture != DXGI_FORMAT_UNKNOWN)
+    if (sys->picQuadConfig->formatTexture == DXGI_FORMAT_UNKNOWN)
+        sys->sys.pool = picture_pool_NewFromFormat( &surface_fmt, pool_size );
+    else
     {
         if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->picQuadConfig, &surface_fmt, pool_size, textures))
             goto error;
@@ -633,31 +642,19 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
             /* each picture_t holds a ref to the context and release it on Destroy */
             ID3D11DeviceContext_AddRef(picsys->context);
         }
-    }
 
 #ifdef HAVE_ID3D11VIDEODECODER
-    if (is_d3d11_opaque(surface_fmt.i_chroma) && !sys->legacy_shader)
+        if (is_d3d11_opaque(surface_fmt.i_chroma) && !sys->legacy_shader)
 #endif
-    {
-        for (picture_count = 0; picture_count < pool_size; picture_count++) {
-            if (AllocateShaderView(VLC_OBJECT(vd), sys->d3d_dev.d3ddevice, sys->picQuadConfig,
-                                   pictures[picture_count]->p_sys->texture, picture_count,
-                                   pictures[picture_count]->p_sys->resourceView))
-                goto error;
+        {
+            for (picture_count = 0; picture_count < pool_size; picture_count++) {
+                if (AllocateShaderView(VLC_OBJECT(vd), sys->d3d_dev.d3ddevice, sys->picQuadConfig,
+                                       pictures[picture_count]->p_sys->texture, picture_count,
+                                       pictures[picture_count]->p_sys->resourceView))
+                    goto error;
+            }
         }
-    }
-
-    if (SetupQuad( vd, &surface_fmt, &sys->picQuad, &sys->sys.rect_src_clipped,
-                   sys->picQuadConfig, sys->picQuadPixelShader,
-                   surface_fmt.projection_mode, vd->fmt.orientation ) != VLC_SUCCESS) {
-        msg_Err(vd, "Could not Create the main quad picture.");
-        return NULL;
-    }
 
-    if (sys->picQuadConfig->formatTexture == DXGI_FORMAT_UNKNOWN)
-        sys->sys.pool = picture_pool_NewFromFormat( &surface_fmt, pool_size );
-    else
-    {
         picture_pool_configuration_t pool_cfg = {
             .picture       = pictures,
             .picture_count = pool_size,



More information about the vlc-commits mailing list