mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
13 lines
373 B
WebGPU Shading Language
13 lines
373 B
WebGPU Shading Language
@group(0) @binding(0)
|
|
var image: texture_storage_2d<r64uint, atomic>;
|
|
|
|
@compute
|
|
@workgroup_size(4, 4, 1)
|
|
fn cs_main(@builtin(local_invocation_id) id: vec3<u32>, @builtin(workgroup_id) group_id: vec3<u32>) {
|
|
let pixel = id + group_id * 4;
|
|
textureAtomicMax(image, pixel.xy, u64(pixel.x));
|
|
|
|
storageBarrier();
|
|
|
|
textureAtomicMin(image, pixel.xy, u64(pixel.y));
|
|
} |