Better follow HLSL offsets rules (#3575)

Matrices consuming one vector are treated like vectors for alignment, and
there is no "trailing padding" for matrices and arrays.
This commit is contained in:
Pavel Asyutchenko 2024-04-18 01:34:28 +02:00 committed by GitHub
parent 9001ec9aa5
commit 593dbafd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 229 additions and 8 deletions

View file

@ -1057,7 +1057,7 @@ public:
static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor);
static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
static bool improperStraddle(const TType& type, int size, int offset);
static bool improperStraddle(const TType& type, int size, int offset, bool vectorLike);
static void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize);
static int getOffset(const TType& type, int index);
static int getBlockSize(const TType& blockType);