[vlc-devel] [PATCH] direct3d11: fix the staging texture alignment

Steve Lhomme robux4 at videolabs.io
Tue Mar 28 15:14:03 CEST 2017


--
replaces https://patches.videolan.org/patch/16176/
* cleaner/safer test for the staging format in use
---
 modules/video_output/win32/direct3d11.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 57bf6331d5..1b4dee7325 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -823,6 +823,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         video_format_Copy(&staging_fmt, &vd->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_NV12 ||
+             sys->picQuadConfig->formatTexture == DXGI_FORMAT_P010 )
+        {
+            staging_fmt.i_width  = (staging_fmt.i_width  + 1) & ~1;
+            staging_fmt.i_height = (staging_fmt.i_height + 1) & ~1;
+        }
         if (AllocateTextures(vd, sys->picQuadConfig, &staging_fmt, 1, textures))
             goto error;
 
-- 
2.11.1



More information about the vlc-devel mailing list