[vlc-commits] d3d_shaders: bump the alignment of constant buffers to 256

Steve Lhomme git at videolan.org
Wed Feb 10 11:06:53 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 27 10:22:03 2021 +0100| [97b23a12eba6fb353c5d4057bd7374d7d0053285] | committer: Steve Lhomme

d3d_shaders: bump the alignment of constant buffers to 256

This is a requirement of D3D12.

We might as well merge PS_CONSTANT_BUFFER and PS_COLOR_TRANSFORM. Copying the
data shouldn't have a significant impact.

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

 modules/video_output/win32/d3d_shaders.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/video_output/win32/d3d_shaders.h b/modules/video_output/win32/d3d_shaders.h
index b93e75a1d8..bc27e98317 100644
--- a/modules/video_output/win32/d3d_shaders.h
+++ b/modules/video_output/win32/d3d_shaders.h
@@ -49,18 +49,21 @@ typedef struct {
     FLOAT LuminanceScale;
     FLOAT BoundaryX;
     FLOAT BoundaryY;
+    FLOAT padding[60]; // 256 bytes alignment
 } PS_CONSTANT_BUFFER;
 
 typedef struct {
     FLOAT WhitePoint[4*4];
     FLOAT Colorspace[4*4];
     FLOAT Primaries[4*4];
+    FLOAT padding[16]; // 256 bytes alignment
 } PS_COLOR_TRANSFORM;
 
 typedef struct {
     FLOAT View[4*4];
     FLOAT Zoom[4*4];
     FLOAT Projection[4*4];
+    FLOAT padding[16]; // 256 bytes alignment
 } VS_PROJECTION_CONST;
 
 typedef struct {



More information about the vlc-commits mailing list