dawn-cmake/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.spvasm.expected.wgsl
Ben Clayton efb17b0254 tint/writer/wgsl: Print @offset attributes as comment
We use WGSL to visualize the AST. Make sure we don't hide anything.

Bug: tint:1776
Change-Id: Iedd7ca797fb745d9db7d0aba8a5718039241afbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112602
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-12-01 17:37:56 +00:00

44 lines
839 B
WebGPU Shading Language

struct S_atomic {
/* @offset(0) */
x : i32,
/* @offset(4) */
a : atomic<u32>,
/* @offset(8) */
b : atomic<u32>,
}
struct S {
/* @offset(0) */
x : i32,
/* @offset(4) */
a : u32,
/* @offset(8) */
b : u32,
}
var<private> local_invocation_index_1 : u32;
var<workgroup> wg : S_atomic;
fn compute_main_inner(local_invocation_index : u32) {
wg.x = 0i;
atomicStore(&(wg.a), 0u);
atomicStore(&(wg.b), 0u);
workgroupBarrier();
atomicStore(&(wg.a), 1u);
atomicStore(&(wg.b), 2u);
return;
}
fn compute_main_1() {
let x_39 : u32 = local_invocation_index_1;
compute_main_inner(x_39);
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();
}