HLSL: implement #pragma pack_matrix(layout)
This adds support for #pragma pack_matrix() to the HLSL front end. The pragma sets the default matrix layout for subsequent unqualified matrices in structs or buffers. Explicit qualification overrides the pragma value. Matrix layout is not permitted at the structure level in HLSL, so only leaves which are matrix types can be so qualified. Note that due to the semantic (not layout) difference in first matrix indirections between HLSL and SPIR-V, the sense of row and column major are flipped. That's independent of this PR: just a factor to note. A column_major qualifier appears as a RowMajor member decoration in SPIR-V modules, and vice versa.
Showing
- Test/baseResults/hlsl.matpack-pragma.frag.out 268 additions, 0 deletionsTest/baseResults/hlsl.matpack-pragma.frag.out
- Test/hlsl.matpack-pragma.frag 33 additions, 0 deletionsTest/hlsl.matpack-pragma.frag
- gtests/Hlsl.FromFile.cpp 1 addition, 0 deletionsgtests/Hlsl.FromFile.cpp
- hlsl/hlslParseHelper.cpp 27 additions, 0 deletionshlsl/hlslParseHelper.cpp
Loading
Please register or sign in to comment