Merge pull request #2439 from KhronosGroup/fix-2261
[KhronosGroup/SPIRV-Cross.git] / shaders / comp / shared.comp
blob4deff9359714cce554e51b3e71e334672cde9e4d
1 #version 310 es
2 layout(local_size_x = 4) in;
4 shared float sShared[gl_WorkGroupSize.x];
6 layout(std430, binding = 0) readonly buffer SSBO
8     float in_data[];
9 };
11 layout(std430, binding = 1) writeonly buffer SSBO2
13     float out_data[];
16 void main()
18     uint ident = gl_GlobalInvocationID.x;
19     float idata = in_data[ident];
21     sShared[gl_LocalInvocationIndex] = idata;
22     memoryBarrierShared();
23     barrier();
25     out_data[ident] = sShared[gl_WorkGroupSize.x - gl_LocalInvocationIndex - 1u];