mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-24 03:39:51 +00:00
898f5fbef7
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
28 lines
435 B
GLSL
28 lines
435 B
GLSL
struct MyBuffer1
|
|
{
|
|
column_major float4x4 mat1;
|
|
row_major float4x4 mat2;
|
|
float4 vec1;
|
|
float foo;
|
|
};
|
|
|
|
struct MyBuffer2
|
|
{
|
|
row_major float4x4 mat1;
|
|
float4 vec1;
|
|
};
|
|
|
|
cbuffer Example
|
|
{
|
|
MyBuffer1 g_MyBuffer1;
|
|
MyBuffer2 g_MyBuffer2;
|
|
column_major float4x4 mat1a;
|
|
};
|
|
|
|
float4 main() : SV_Target0
|
|
{
|
|
return mul(g_MyBuffer1.mat1, g_MyBuffer1.vec1) +
|
|
mul(g_MyBuffer2.mat1, g_MyBuffer2.vec1);
|
|
}
|
|
|