mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
This CL makes the builtin argument resolve as a shadowable enumerator expression. Bug: tint:1841 Bug: tint:1845 Change-Id: I2aaa2c63025752f25c113cf2fb38f4d91c2c16c2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120680 Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
43 lines
790 B
WebGPU Shading Language
43 lines
790 B
WebGPU Shading Language
struct S_atomic {
|
|
/* @offset(0) */
|
|
x : i32,
|
|
/* @offset(4) */
|
|
a : atomic<u32>,
|
|
/* @offset(8) */
|
|
y : u32,
|
|
}
|
|
|
|
struct S {
|
|
/* @offset(0) */
|
|
x : i32,
|
|
/* @offset(4) */
|
|
a : u32,
|
|
/* @offset(8) */
|
|
y : u32,
|
|
}
|
|
|
|
var<private> local_invocation_index_1 : u32;
|
|
|
|
var<workgroup> wg : S_atomic;
|
|
|
|
fn compute_main_inner(local_invocation_index_2 : u32) {
|
|
wg.x = 0i;
|
|
atomicStore(&(wg.a), 0u);
|
|
wg.y = 0u;
|
|
workgroupBarrier();
|
|
atomicStore(&(wg.a), 1u);
|
|
return;
|
|
}
|
|
|
|
fn compute_main_1() {
|
|
let x_35 : u32 = local_invocation_index_1;
|
|
compute_main_inner(x_35);
|
|
return;
|
|
}
|
|
|
|
@compute @workgroup_size(1i, 1i, 1i)
|
|
fn compute_main(@builtin(local_invocation_index) local_invocation_index_1_param : u32) {
|
|
local_invocation_index_1 = local_invocation_index_1_param;
|
|
compute_main_1();
|
|
}
|