SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/frag/struct-packing-last-element-array-matrix-rule.invalid.asm.frag
Hans-Kristian Arntzen fad36a6b28 HLSL: Deal with partially filled 16-byte word in cbuffers.
The last element of an array or matrix in HLSL cbuffers are not filled
completely, but only have a size equal to the base vector.
2020-08-20 16:05:21 +02:00

43 lines
562 B
GLSL

struct Foo
{
row_major float3x3 m[2];
float v;
};
struct Bar
{
row_major float3x3 m;
float v;
};
cbuffer FooUBO : register(b0)
{
Foo _6_foo : packoffset(c0);
};
cbuffer BarUBO : register(b1)
{
Bar _9_bar : packoffset(c0);
};
static float4 FragColor;
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = (_6_foo.v + _9_bar.v).xxxx;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}