atomicCompareExchangeWeak
함수
Stores the third argument into the atomic location only when it holds the second, as one indivisible step.
이름마다 붙은 시그니처와 설명은 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
declare function atomicCompareExchangeWeak<T extends u32 | i32>(location: atomic<T>, compare: T, value: T): { old_value: T; exchanged: bool }매개변수
-
locationatomic<T> -
compareT -
valueT
반환값
{ old_value: T; exchanged: bool }
설명
Answers a struct: old_value is what the location held before the call and exchanged says whether the store happened. WGSL gives that struct no writable name, so bind the result with const and read its fields.
대상별 출력
- WGSL
-
atomicCompareExchangeWeak(&a, b, c) - GLSL ES 3.00
- atomicCompareExchangeWeak has no GLSL ES 3.00 spelling (no storage buffers, no atomics)