Repository navigation
|
From a question on the matrix chat.
|
Replies: 4 comments
|
In short: workgroupBarrier and storageBarrier cannot be used to synchronize memory accesses between different workgroups. From the spec, see https://www.w3.org/TR/WGSL/#scoped-operations and https://www.w3.org/TR/WGSL/#sync-builtin-functions and the last bit of https://www.w3.org/TR/WGSL/#compute-shader-workgroups (where the spec says workgroups execute independently in the sense that one workgroup can't block another workgroup). In hopefully more digestible terms:
Why does WGSL have this limitation. Atomics are a different story. They can provide visibility and availability guarantees in storage address space and across workgroups.
Think of "QueueFamily" as device-wide. I hope I got all that right, and I hope that's helpful. |
|
If we want to put this explanation in the spec, this becomes editorial? |
|
I lean against. There is so much more required to explain than this well. E.g. a synchronization chain through barrier -> atomic -> atomic -> barrier. |
WGSL 2023-03-07 Minutes
|
In short: workgroupBarrier and storageBarrier cannot be used to synchronize memory accesses between different workgroups.
From the spec, see https://www.w3.org/TR/WGSL/#scoped-operations and https://www.w3.org/TR/WGSL/#sync-builtin-functions and the last bit of https://www.w3.org/TR/WGSL/#compute-shader-workgroups (where the spec says workgroups execute independently in the sense that one workgroup can't block another workgroup).
In hopefully more digestible terms:
a workgroupBarrier: coordinates the following among all invocations in the current workgroup: