You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point, I think it would be great to have the ability to set control access barriers and access more of the WGSL specific functionality within a TSL function. I've tried implementing some of these access barriers myself in a personal branch, using an approach similar to that of the 'vec2', 'vec3', 'etc' ConvertTypes in ShaderNode.js. However, it seems like the node system is heavily weighted towards nodes that explicitly represent some kind of mathematical operation, so, at least from my end, it's not as simple as just adding another node type.
Solution
export const workgroupBarrier = new BarrierType('workgroup');
And then be accessed from a tslFn like so...
tslFn( () => {
...
workgroupBarrier()
...
})
I'm not sure if there's currently a relevant use case for these barriers, but once subgroups become stable, I imagine commands like workgroupBarrier() or subgroupBarrier() would be very useful for things like prefix sums for spatial hash grids.
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Also posting to see if barriers are possible for subsets of the compute shader? I.e. workers in a smaller workgroup subset all wait at a barrier together, but don't wait for other subsets. Ex:
tslFn( () => {
const workgroup_idx = instanceIndex.mod(4); // 4 workers per group
...
workgroupBarrier(workgroup_idx); // Only waits for the (4) workers in this group
...
});
The workgroupBarrier() function does not take any arguments. As far as I know, there's also no way to directly specify the size of a subgroup in current implementations of WebGPU.
Description
At some point, I think it would be great to have the ability to set control access barriers and access more of the WGSL specific functionality within a TSL function. I've tried implementing some of these access barriers myself in a personal branch, using an approach similar to that of the 'vec2', 'vec3', 'etc' ConvertTypes in ShaderNode.js. However, it seems like the node system is heavily weighted towards nodes that explicitly represent some kind of mathematical operation, so, at least from my end, it's not as simple as just adding another node type.
Solution
And then be accessed from a tslFn like so...
I'm not sure if there's currently a relevant use case for these barriers, but once subgroups become stable, I imagine commands like workgroupBarrier() or subgroupBarrier() would be very useful for things like prefix sums for spatial hash grids.
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: