Debian Codegraph @

third_party/spirv-cross/shaders-msl/comp/complex-type-alias.comp

raw
1 #version 450
2 layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
3
4 struct Foo0
5 {
6 float a;
7 };
8
9 struct Foo1
10 {
11 Foo0 a;
12 };
13
14 void Zero(out Foo0 v)
15 {
16 v.a = 0.0;
17 }
18
19 struct Foo2
20 {
21 Foo1 a;
22 float weight;
23 };
24
25 layout(std430, binding = 0) buffer SSBO
26 {
27 Foo2 outputs[];
28 };
29
30 shared Foo2 coeffs[64];
31
32 void main()
33 {
34 Foo2 data;
35 data.weight = 0.0;
36 Zero(data.a.a);
37 coeffs[gl_LocalInvocationIndex] = data;
38 barrier();
39 if (gl_LocalInvocationIndex == 0u)
40 outputs[gl_WorkGroupID.x] = coeffs[0];
41 }