6// Define the binding group layout
7@group(0) @binding(1) var<storage, read_write> result: array<u32>;
8@group(0) @binding(2) var<storage, read_write> aux: array<u32>;
10const WORKGROUP_SIZE : u32 = 256u;
12@compute @workgroup_size(WORKGROUP_SIZE)
14 @builtin(global_invocation_id) global_id: vec3<u32>,
15 @builtin(local_invocation_id) local_id: vec3<u32>,
16 @builtin(workgroup_id) group_id: vec3<u32>
18 let gid = global_id.x;
20 if gid < arrayLength(&result) {
21 result[gid] = result[gid] + aux[wid];
shader_source
Definition add_block_sums.wgsl.h:5