third_party/spirv-cross/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
raw| 1 | #version 450 |
| 2 | layout(local_size_x = 8) in; |
| 3 | |
| 4 | shared float shared_group[8][8]; |
| 5 | shared float shared_group_alt[8][8]; |
| 6 | |
| 7 | void main() |
| 8 | { |
| 9 | float blob[8]; |
| 10 | for (int i = 0; i < 8; i++) |
| 11 | blob[i] = float(i); |
| 12 | shared_group[gl_LocalInvocationIndex] = blob; |
| 13 | |
| 14 | barrier(); |
| 15 | |
| 16 | float copied_blob[8] = shared_group[gl_LocalInvocationIndex ^ 1u]; |
| 17 | shared_group_alt[gl_LocalInvocationIndex] = shared_group[gl_LocalInvocationIndex]; |
| 18 | } |