This commit is contained in:
nora 2024-10-30 20:12:31 +01:00
commit 1a07df64ca
4 changed files with 192 additions and 0 deletions

19
mandelbrot.wgsl Normal file
View file

@ -0,0 +1,19 @@
@group(0) @binding(0)
var<storage, read_write> output: array<f32>;
@compute @workgroup_size(64)
fn main(
@builtin(global_invocation_id)
global_id : vec3u,
@builtin(local_invocation_id)
local_id : vec3u,
) {
// Avoid accessing the buffer out of bounds
if (global_id.x >= 1000) {
return;
}
output[global_id.x] =
f32(local_id.x);
}