Files
WebGPU-Framework/shaders/copyBuffer.wgsl

15 lines
356 B
WebGPU Shading Language
Raw Normal View History

2025-11-17 15:06:39 +01:00
@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];
}