mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-09 14:45:58 +00:00
We cannot explicitly name the result type of this builtin, so we have to redeclare it manually. Fixed: oss-fuzz:53347, oss-fuzz:53343 Change-Id: I23816b8b35eb20ae91472143ab30668b573d65bf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110160 Commit-Queue: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Auto-Submit: James Price <jrprice@google.com>
13 lines
252 B
WebGPU Shading Language
13 lines
252 B
WebGPU Shading Language
@group(0) @binding(0) var<storage, read_write> a : atomic<i32>;
|
|
|
|
@fragment
|
|
fn foo() -> @location(0) i32 {
|
|
discard;
|
|
var x = 0;
|
|
let result = atomicCompareExchangeWeak(&a, 0, 1);
|
|
if (result.exchanged) {
|
|
x = result.old_value;
|
|
}
|
|
return x;
|
|
}
|