mirror of
https://github.com/Noratrieb/webgpu-mandelbrot.git
synced 2026-01-14 17:05:02 +01:00
19 lines
356 B
WebGPU Shading Language
19 lines
356 B
WebGPU Shading Language
@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);
|
|
}
|