ATOMIC_INTRINSICS
Constant in Backends
The atomic builtins, with the arity and result of each: atomicLoad takes the location alone and returns its value; atomicStore takes a value and returns nothing; the eight read-modify-write forms take a value and return the value the location held before the update.
import { ATOMIC_INTRINSICS } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
const ATOMIC_INTRINSICS: Readonly<Record<string, { readonly arity: 1 | 2 | 3; readonly returns: "value" | "void" | "casResult"; }>>Description
Every one takes its first argument as a location (xs[i], a storage
struct field, a bare atomic binding), which WGSL spells as a pointer, &xs[i], and which the
CPU backends resolve once and write back through. The GLSL lowering of an atomic is not
supported yet (Rule 10.5); a @compute entry that reaches no texture runs the atomics
other than atomicCompareExchangeWeak on WebGL2 as its pass program (Rule 11.8).
Source
src/core/intrinsics.ts, line 93, at commit af54ddad5