third_party/spirv-cross/shaders-reflection/comp/struct-layout.comp
raw| 1 | #version 310 es |
| 2 | layout(local_size_x = 1) in; |
| 3 | |
| 4 | struct Foo |
| 5 | { |
| 6 | mat4 m; |
| 7 | }; |
| 8 | |
| 9 | layout(std430, binding = 0) readonly buffer SSBO |
| 10 | { |
| 11 | Foo in_data[]; |
| 12 | }; |
| 13 | |
| 14 | layout(std430, binding = 1) writeonly buffer SSBO2 |
| 15 | { |
| 16 | Foo out_data[]; |
| 17 | }; |
| 18 | |
| 19 | void main() |
| 20 | { |
| 21 | uint ident = gl_GlobalInvocationID.x; |
| 22 | out_data[ident].m = in_data[ident].m * in_data[ident].m; |
| 23 | } |
| 24 |