INTRINSIC_HELPERS
Constant in Backends
The helper functions an intrinsic's GLSL spelling calls, keyed by intrinsic id.
import { INTRINSIC_HELPERS } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
const INTRINSIC_HELPERS: Readonly<Record<string, { readonly fn: string; readonly def: string; }>>Description
fn is the
name the spelling calls and def is the GLSL definition of that function. A GLSL writer must
emit def for every listed intrinsic that a reachable function calls; otherwise the spelling
calls a function the shader never defines. Each definition calls only GLSL builtins, so the
definitions can be emitted in any order at the top of the function section, with no
prototype. A helper that nothing calls compiles but adds bytes, so key the emit off the calls
actually collected.
Only the GLSL target has helpers: WGSL indexes storage buffers directly. Exported from
typeshade.
Source
src/core/intrinsics.ts, line 1005, at commit 26de7be8