third_party/spirv-cross/shaders/comp/culling.comp
raw| 1 | #version 310 es |
| 2 | layout(local_size_x = 4) in; |
| 3 | |
| 4 | layout(std430, binding = 0) readonly buffer SSBO |
| 5 | { |
| 6 | float in_data[]; |
| 7 | }; |
| 8 | |
| 9 | layout(std430, binding = 1) writeonly buffer SSBO2 |
| 10 | { |
| 11 | float out_data[]; |
| 12 | }; |
| 13 | |
| 14 | layout(std430, binding = 2) buffer SSBO3 |
| 15 | { |
| 16 | uint count; |
| 17 | }; |
| 18 | |
| 19 | void main() |
| 20 | { |
| 21 | uint ident = gl_GlobalInvocationID.x; |
| 22 | float idata = in_data[ident]; |
| 23 | if (idata > 12.0) |
| 24 | out_data[atomicAdd(count, 1u)] = idata; |
| 25 | } |
| 26 |