Debian Codegraph @

third_party/spirv-cross/reference/shaders-hlsl/frag/row-major-layout-in-struct.frag

raw
1 struct NonFoo
2 {
3 float4x4 v;
4 float4x4 w;
5 };
6
7 struct Foo
8 {
9 row_major float4x4 v;
10 row_major float4x4 w;
11 };
12
13 cbuffer UBO : register(b0)
14 {
15 Foo _17_foo : packoffset(c0);
16 };
17
18
19 static float4 FragColor;
20 static float4 vUV;
21
22 struct SPIRV_Cross_Input
23 {
24 float4 vUV : TEXCOORD0;
25 };
26
27 struct SPIRV_Cross_Output
28 {
29 float4 FragColor : SV_Target0;
30 };
31
32 void frag_main()
33 {
34 NonFoo f;
35 f.v = _17_foo.v;
36 f.w = _17_foo.w;
37 FragColor = mul(mul(vUV, f.w), f.v);
38 }
39
40 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
41 {
42 vUV = stage_input.vUV;
43 frag_main();
44 SPIRV_Cross_Output stage_output;
45 stage_output.FragColor = FragColor;
46 return stage_output;
47 }