[vlc-commits] direct3d11: fix the non-RGB texture creation with odd dimensions

Steve Lhomme git at videolan.org
Tue Jul 11 18:23:22 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Jul 11 16:24:17 2017 +0200| [6bfca16e30937ff8e5ccb6b25e4d0cc6e9cf11b8] | committer: Jean-Baptiste Kempf

direct3d11: fix the non-RGB texture creation with odd dimensions

This case happens when decoding when decoding in software. For example a JPEG.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/win32/direct3d11.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 9b6a879ef5..bf49b87e7e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -675,6 +675,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         surface_fmt.i_width  = (surface_fmt.i_width  + 0x7F) & ~0x7F;
         surface_fmt.i_height = (surface_fmt.i_height + 0x7F) & ~0x7F;
     }
+    else if ( sys->picQuadConfig->formatTexture != DXGI_FORMAT_R8G8B8A8_UNORM &&
+              sys->picQuadConfig->formatTexture != DXGI_FORMAT_B5G6R5_UNORM )
+    {
+        surface_fmt.i_width  = (surface_fmt.i_width  + 0x01) & ~0x01;
+        surface_fmt.i_height = (surface_fmt.i_height + 0x01) & ~0x01;
+    }
 
     if (AllocateTextures(vd, sys->picQuadConfig, &surface_fmt, pool_size, textures,
                          true))
@@ -732,6 +738,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         video_format_Copy(&staging_fmt, &surface_fmt);
         staging_fmt.i_width = staging_fmt.i_visible_width;
         staging_fmt.i_height = staging_fmt.i_visible_height;
+        if ( sys->picQuadConfig->formatTexture != DXGI_FORMAT_R8G8B8A8_UNORM &&
+             sys->picQuadConfig->formatTexture != DXGI_FORMAT_B5G6R5_UNORM )
+        {
+            staging_fmt.i_width  = (staging_fmt.i_width  + 0x01) & ~0x01;
+            staging_fmt.i_height = (staging_fmt.i_height + 0x01) & ~0x01;
+        }
         if (AllocateTextures(vd, sys->picQuadConfig, &staging_fmt, 1, textures, true))
             goto error;
 



More information about the vlc-commits mailing list