HLSL: fix qualifier propagation from user struct types to block definitions.
The HLSL FE tracks four versions of a declared type to avoid losing information, since it is not (at type-decl time) known how the type will be used downstream. If such a type was used in a cbuffer declaration, the cbuffer type's members should have been using the uniform form of the original user structure type, but were not. This would manifest as matrix qualifiers (and other things, such as pack offsets) on user struct members going missing in the SPIR-V module if the struct type was a member of a cbuffer, like so: struct MyBuffer { row_major float4x4 mat1; column_major float4x4 mat2; }; cbuffer Example { MyBuffer g_MyBuffer; }; Fixes: #789
Showing
- Test/baseResults/hlsl.matpack-1.frag.out 187 additions, 0 deletionsTest/baseResults/hlsl.matpack-1.frag.out
- Test/baseResults/hlsl.structIoFourWay.frag.out 12 additions, 22 deletionsTest/baseResults/hlsl.structIoFourWay.frag.out
- Test/hlsl.matpack-1.frag 27 additions, 0 deletionsTest/hlsl.matpack-1.frag
- gtests/Hlsl.FromFile.cpp 1 addition, 0 deletionsgtests/Hlsl.FromFile.cpp
- hlsl/hlslParseHelper.cpp 3 additions, 3 deletionshlsl/hlslParseHelper.cpp
Loading
Please register or sign in to comment