dawn-cmake/test/intrinsics/gen/atomicAdd/d5db1d.wgsl.expected.msl
Ben Clayton e6d171ac66 writer/hlsl: Implement atomics
Storage buffers are emitted as `ByteAddressBuffer`s in HLSL, so we have to jump through hoops to support atomic ops on storage buffer atomics.
Workgroup atomics are far more conventional, but very little code can be shared between these two code paths.

Bug: tint:892
Change-Id: If10ea866e3b67a093e87aca689d34065fd49b705
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54651
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-06-18 18:56:13 +00:00

15 lines
378 B
Plaintext

SKIP: FAILED
fn atomicAdd_d5db1d(tint_symbol : ptr<workgroup, atomic<u32>>) {
var res : u32 = atomicAdd(&(*(tint_symbol)), 1u);
}
[[stage(compute)]]
fn compute_main() {
[[internal(disable_validation__function_var_storage_class)]] var<workgroup> tint_symbol_1 : atomic<u32>;
atomicAdd_d5db1d(&(tint_symbol_1));
}
error: cannot declare an atomic var in a function scope