1#import bevy_hanabi::vfx_common::{BatchInfo, DispatchIndirectArgs} 3@group(0) @binding(0) var<storage, read_write> batch_infos : array<BatchInfo>; 4@group(0) @binding(1) var<storage, read_write> prefix_sum : array<u32>; 5@group(0) @binding(2) var<storage, read_write> dispatch_indirect_buffer : array<DispatchIndirectArgs>; 13@compute @workgroup_size(64) 14fn main(@builtin(global_invocation_id) global_invocation_id: vec3<u32>) { 16 let batch_index = global_invocation_id.x; 17 let batch_count = arrayLength(&batch_infos); 18 if (batch_index >= batch_count) { 23 let offset = batch_infos[batch_index].prefix_sum_offset; 24 let count = batch_infos[batch_index].prefix_sum_count; 27 let end = offset + count; 29 for (var i = offset; i < end; i += 1u) { 30 let count = prefix_sum[i]; 37 batch_infos[batch_index].total_update_count = sum; 40 dispatch_indirect_buffer[batch_index].x = (sum + 63u) >> 6u; 41 dispatch_indirect_buffer[batch_index].y = 1u; 42 dispatch_indirect_buffer[batch_index].z = 1u;