2021-06-24 19:01:06 +00:00
|
|
|
struct DrawIndirectArgs {
|
|
|
|
vertexCount : atomic<u32>;
|
2022-01-19 18:11:17 +00:00
|
|
|
}
|
2021-06-24 19:01:06 +00:00
|
|
|
|
2022-01-19 22:46:57 +00:00
|
|
|
@group(0) @binding(5) var<storage, read_write> drawOut : DrawIndirectArgs;
|
2021-06-24 19:01:06 +00:00
|
|
|
|
|
|
|
var<private> cubeVerts : u32 = 0u;
|
|
|
|
|
2022-01-19 22:46:57 +00:00
|
|
|
@stage(compute) @workgroup_size(1)
|
|
|
|
fn computeMain(@builtin(global_invocation_id) global_id : vec3<u32>) {
|
2021-06-24 19:01:06 +00:00
|
|
|
let firstVertex : u32 = atomicAdd(&(drawOut.vertexCount), cubeVerts);
|
|
|
|
}
|