Debian Codegraph @

third_party/spirv-cross/shaders-msl/comp/shared.comp

raw
1 #version 310 es
2 layout(local_size_x = 4) in;
3
4 shared float sShared[gl_WorkGroupSize.x];
5
6 layout(std430, binding = 0) readonly buffer SSBO
7 {
8 float in_data[];
9 };
10
11 layout(std430, binding = 1) writeonly buffer SSBO2
12 {
13 float out_data[];
14 };
15
16 void main()
17 {
18 uint ident = gl_GlobalInvocationID.x;
19 float idata = in_data[ident];
20
21 sShared[gl_LocalInvocationIndex] = idata;
22 memoryBarrierShared();
23 barrier();
24
25 out_data[ident] = sShared[gl_WorkGroupSize.x - gl_LocalInvocationIndex - 1u];
26 }
27