SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag
Hans-Kristian Arntzen f1e8555801 Emit matrix layouts in structs directly.
Unlike GLSL, child structs do not inherit matrix layouts.
2018-06-05 09:42:07 +02:00

38 lines
587 B
GLSL

struct Foo
{
row_major float4x4 v;
row_major float4x4 w;
};
cbuffer _17 : register(b0)
{
Foo _17_foo : packoffset(c0);
};
static float4 FragColor;
static float4 vUV;
struct SPIRV_Cross_Input
{
float4 vUV : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = mul(mul(vUV, _17_foo.w), _17_foo.v);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vUV = stage_input.vUV;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}