[vlc-devel] [PATCH 2/2] direct3d11: align GPU surfaces to 128 octets, the max required for any codec

Steve Lhomme robux4 at videolabs.io
Wed Mar 22 14:11:36 CET 2017


Fixes #17856
---
 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 510e9b0352..e6082096d7 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1622,6 +1622,12 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
                  (char *)&fmt->i_chroma );
     fmt->i_chroma = sys->picQuadConfig->fourcc;
     DxgiFormatMask( sys->picQuadConfig->formatTexture, fmt );
+    if (is_d3d11_opaque(vd->source.i_chroma))
+    {
+        /* worst case scenario we need 128 alignment for HEVC */
+        fmt->i_width  = (fmt->i_width  + 0x7F) & ~0x7F;
+        fmt->i_height = (fmt->i_height + 0x7F) & ~0x7F;
+    }
 
     /* check the region pixel format */
     sys->d3dregion_format = GetOutputFormat(vd, VLC_CODEC_RGBA, 0, false, true);
-- 
2.11.1



More information about the vlc-devel mailing list