mach/examples/map-async/main.wgsl
Lucas Romanó 7de47a8f2d examples: add map-async example
Signed-off-by: Lucas Romanó <9062026+lucasromanosantos@users.noreply.github.com>
2022-07-17 09:27:29 -07:00

16 lines
368 B
WebGPU Shading Language

@group(0) @binding(0) var<storage, write> output: array<f32>;
@stage(compute) @workgroup_size(64, 1, 1)
fn main(
@builtin(global_invocation_id)
global_id : vec3<u32>,
@builtin(local_invocation_id)
local_id : vec3<u32>,
) {
if (global_id.x >= arrayLength(&output)) {
return;
}
output[global_id.x] =
f32(global_id.x) * 1000. + f32(local_id.x);
}