CAS_RESULT_STRUCTS
이 페이지에서

CAS_RESULT_STRUCTS

상수, 타입 분류

The struct atomicCompareExchangeWeak answers: the contents the location held before the call, and whether the exchange happened.

import { CAS_RESULT_STRUCTS } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const CAS_RESULT_STRUCTS: readonly { readonly name: string; readonly fields: readonly { readonly name: string; readonly type: ShaderType; }[]; }[]

설명

WGSL calls the type __atomic_compare_exchange_result<T> and gives no way to write that name — measured on Tint, a variable declared with it is “invalid type for variable declaration” — so the result is bound by inference and its fields read.

It is a struct the IR types and no backend declares: WGSL’s is built in, so emitting a struct for it would shadow the builtin one, and the emitted code never names the type (let r = atomicCompareExchangeWeak(&x, a, b); infers it). That is why these two decls are constants here rather than entries in a module’s structs.

소스

src/core/ir/types.ts, 151행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고