Debian Codegraph @

third_party/spirv-cross/reference/shaders/vulkan/comp/spec-constant-op-member-array.vk.comp.vk

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