1#version 310 es
2layout(local_size_x = 4) in;
3
4shared float sShared[gl_WorkGroupSize.x];
5
6layout(std430, binding = 0) readonly buffer SSBO
7{
8    float in_data[];
9};
10
11layout(std430, binding = 1) writeonly buffer SSBO2
12{
13    float out_data[];
14};
15
16void 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
28