mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-14 17:16:01 +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>
19 lines
319 B
HLSL
19 lines
319 B
HLSL
RWByteAddressBuffer sb_rw : register(u0, space0);
|
|
|
|
void atomicLoad_fe6cc3() {
|
|
uint atomic_result = 0u;
|
|
sb_rw.InterlockedOr(0u, 0, atomic_result);
|
|
uint res = atomic_result;
|
|
}
|
|
|
|
void fragment_main() {
|
|
atomicLoad_fe6cc3();
|
|
return;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void compute_main() {
|
|
atomicLoad_fe6cc3();
|
|
return;
|
|
}
|