Sign in
dawn
/
dawn
/
32363954436092f4d0c5f2c8dd5f1fa8f2ff00af
/
.
/
test
/
tint
/
statements
/
discard
/
atomic_cmpxchg.wgsl
blob: f87ebac2327c9562bc8f4e33459926563a82d2f0 [
file
] [
log
] [
blame
]
@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
;
}