Debian Codegraph @

third_party/spirv-cross/shaders-hlsl/comp/spec-constant-op-member-array.comp

raw
1 #version 450
2 layout(local_size_x = 1) in;
3
4 layout(constant_id = 0) const int a = 100;
5 layout(constant_id = 1) const int b = 200;
6 layout(constant_id = 2) const int c = 300;
7 const int d = c + 50;
8 layout(constant_id = 3) const int e = 400;
9
10 struct A
11 {
12 int member0[a];
13 int member1[b];
14 };
15
16 struct B
17 {
18 int member0[b];
19 int member1[a];
20 };
21
22 layout(set = 1, binding = 0) buffer SSBO
23 {
24 A member_a;
25 B member_b;
26 int v[a];
27 int w[d];
28 };
29
30 void main()
31 {
32 w[gl_GlobalInvocationID.x] += v[gl_GlobalInvocationID.x] + e;
33 }