particle_update.comp 396 B

1234567891011121314151617181920
  1. #version 430 core
  2. uniform int max_val;
  3. uniform int count;
  4. layout(std430, binding = 1) coherent buffer dataBuffer
  5. {
  6. int data_SSBO[];
  7. };
  8. layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in;
  9. void main(){
  10. if(gl_GlobalInvocationID.x >= count){
  11. return;
  12. }
  13. if(data_SSBO[gl_GlobalInvocationID.x] > max_val){
  14. data_SSBO[gl_GlobalInvocationID.x] = 0;
  15. }
  16. }