mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 04:05:40 +00:00
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>
14 lines
226 B
HLSL
14 lines
226 B
HLSL
groupshared int arg_0;
|
|
|
|
void atomicAdd_794055() {
|
|
int atomic_result = 0;
|
|
InterlockedAdd(arg_0, 1, atomic_result);
|
|
int res = atomic_result;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void compute_main() {
|
|
atomicAdd_794055();
|
|
return;
|
|
}
|