Backends

Backends

27 members

The backend contract, the capability model and the registry that spells an intrinsic.

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

ATOMIC_INTRINSICS Constant
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.
Backend Interface
The contract a target writer implements.
BARRIER_INTRINSICS Constant
The barriers: workgroupBarrier() and storageBarrier(), statements with no value that every invocation of a workgroup reaches before any runs on.
barrierOutsideDispatch Function
The error every CPU path throws when a barrier runs outside a dispatch: a barrier waits for the other invocations of the workgroup, and one invocation run alone, by a direct fns call or by a debug session, has none.
Capabilities Class
The set of capabilities a backend supports, built from its capProfile with Capabilities.fromProfile.
capabilityMatrix Function
Report which backend can spell which capability, as one row per capability with a support class per backend.
CapabilityRow Interface
One row of the capability matrix: a capability and how each backend supports it.
CapProfile Type
A backend's capability table, and the single authority for what its target supports.
CapSupport Interface
What one capability costs on one target: the row of a backend's capProfile.
CapSupportKind Type
How one backend supports one capability. - 'native': supported, with nothing to emit and nothing for the host to turn on. - 'directive': supported, and the emitted source declares it.
DERIVATIVE_INTRINSICS Constant
The intrinsics whose value is a difference between neighbouring invocations, so WGSL requires uniform control flow at the call: the derivatives themselves and every sampling form that derives its level of detail implicitly.
hostFeaturesFor Function
Translate neutral capability ids into the feature strings one target's host has to activate before it creates a pipeline.
INTRINSIC_BINDING_REFS Constant
The binding names an intrinsic's emitted text reads directly, keyed by intrinsic id, for the intrinsics whose spelling names a binding with no argument carrying it.
INTRINSIC_HELPERS Constant
The helper functions an intrinsic's GLSL spelling calls, keyed by intrinsic id.
intrinsicNeedsAtomArgs Function
Returns true when name's spelling splices an argument into a position that binds tighter than a plain argument slot, such as an operand of an inlined operator or the base of a .field postfix.
INTRINSICS Constant
The spelling of each builtin id on each target, keyed by id.
IntrinsicTarget Type
The emit target that spellIntrinsic and the INTRINSICS table spell for: 'wgsl' or 'glsl'.
isAtomicIntrinsic Function
Whether name is one of the ATOMIC_INTRINSICS.
isBarrierIntrinsic Function
Whether name is one of the BARRIER_INTRINSICS.
isKnownIntrinsic Function
Returns true when name is a builtin the registry can spell on every target: either an id with an INTRINSICS entry or a member of PORTABLE_INTRINSICS.
PACKED_4X8_IDS Constant
The eight packed 4x8 integer builtins.
PACKED_4X8_LANGUAGE_FEATURE Constant
The WGSL language feature a module using PACKED_4X8_IDS depends on, as navigator.gpu.wgslLanguageFeatures names it.
PORTABLE_INTRINSICS Constant
The builtin ids that spell identically on both targets, such as sin, dot and clamp.
PRE_EMIT_INTRINSICS Constant
The builtin ids that fp64Lower rewrites away before any backend runs: 'f64', 'f64FromParts' and 'f64Parts'.
spellIntrinsic Function
Spells a call for one target.
TEXTURE_GATHER_IDS Constant
The neutral ids a textureGather / textureGatherCompare call lowers to, one per WGSL argument structure.
UnsupportedFeatureError Class
Thrown when a module needs a feature the target backend does not support, with code SD0030.

Edit this page Report a problem