mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
This will make it easier for contributors to understand the file layout,
at the cost of said layout containing several more nested directories.
I will personally appreciate not having to remember to look for
`root.rs` instead of `main.rs`.
I also renamed the test targets so that they do not *all* share the
superfluous suffix “-test” (test targets live in a different namespace
than other target types and packages, so the name can presume that it
is always known that they are tests).
The Naga snapshot data sets `naga/tests/{in,out}` have been left in
their original positions.
13 lines
373 B
WebGPU Shading Language
13 lines
373 B
WebGPU Shading Language
@group(0) @binding(0)
|
|
var image: texture_storage_2d<r32uint, 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, u32(pixel.x));
|
|
|
|
storageBarrier();
|
|
|
|
textureAtomicMin(image, pixel.xy, u32(pixel.y));
|
|
} |