15 lines
356 B
WebGPU Shading Language
15 lines
356 B
WebGPU Shading Language
|
|
@group(0) @binding(0)
|
||
|
|
var<storage, read> indices: array<u32>;
|
||
|
|
|
||
|
|
@group(0) @binding(1)
|
||
|
|
var<storage, read_write> sortedIndices: array<u32>;
|
||
|
|
|
||
|
|
@compute @workgroup_size(64)
|
||
|
|
fn computeMain(@builtin(global_invocation_id) globalInvocationId: vec3<u32>) {
|
||
|
|
|
||
|
|
let particleIndex = globalInvocationId.x;
|
||
|
|
|
||
|
|
sortedIndices[particleIndex] = indices[particleIndex];
|
||
|
|
|
||
|
|
}
|