examples: add map-async example
Signed-off-by: Lucas Romanó <9062026+lucasromanosantos@users.noreply.github.com>
This commit is contained in:
parent
a825965208
commit
7de47a8f2d
4 changed files with 104 additions and 0 deletions
16
examples/map-async/main.wgsl
Normal file
16
examples/map-async/main.wgsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
@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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue