[vlc-commits] direct3d11: don't use our own pool when rendering to DXGI_FORMAT_UNKNOWN

Steve Lhomme git at videolan.org
Mon Feb 25 14:34:10 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 25 12:55:02 2019 +0100| [0339916f9aceb0e46b2626ad99847d0dc0592f5c] | committer: Steve Lhomme

direct3d11: don't use our own pool when rendering to DXGI_FORMAT_UNKNOWN

We're already using the staging texture to copy from CPU to GPU in that case.

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index e313c8c3c8..8dc97d3802 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -566,7 +566,8 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     else
         vd->info.subpicture_chromas = NULL;
 
-    vd->pool    = Pool;
+    if (sys->picQuad.textureFormat->formatTexture != DXGI_FORMAT_UNKNOWN)
+        vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
@@ -607,10 +608,6 @@ 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 (sys->picQuad.textureFormat->formatTexture == DXGI_FORMAT_UNKNOWN)
-        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;
@@ -677,7 +674,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
             //pool_cfg.unlock        = Direct3D11UnmapPoolTexture;
         }
         sys->sys.pool = picture_pool_NewExtended( &pool_cfg );
-    }
 
 error:
     if (sys->sys.pool == NULL) {



More information about the vlc-commits mailing list