| commit | 3fb6da67612ab1fcbf48e207e4fdbaa33c0b1b1c | [log] [tgz] |
|---|---|---|
| author | dneto <dneto@google.com> | Wed Nov 26 15:48:39 2025 -0800 |
| committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Nov 26 15:48:39 2025 -0800 |
| tree | 2ec1becaad6795ebeb1b7a2db87fba7ceace923e | |
| parent | 2281366e993ee4623561f57ebc4cd3081c954b4a [diff] |
[uniformity] fix connectivity of for-loop without condition
In a loop, a barrier followed by a non-uniform break or return
should cause a uniformity failure.
When a for loop has no condition expression, the control flow node
for the start of the loop body did not connect to the
'start of iteration' control flow node.
The fix is to initialize the start-of-body node to be the
start-of-iter node.
The change makes the following code fail, where before it did not.
fn main(@builtin(local_invocation_index) nonuniform_var: u32, @builtin(num_workgroups) nw: vec3u) {
let uniform_cond = 42 == nw.x;
let nonuniform_cond = 42 == nonuniform_var;
for ( ; ; ) {
workgroupBarrier();
if nonuniform_cond { break; }
}
}
Bug: 463704875
Change-Id: Ieca2905ed2842195cebbd5930e6048316a6a6964
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/276755
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: James Price <jrprice@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.