stageOf()
Function in IR
The stage of a function declaration: 'vertex', 'fragment' or 'compute' for an entry point, undefined for a helper.
import { stageOf } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
const stageOf: ( f: Pick<FuncDecl, "stage" | "attrs">,) => "vertex" | "fragment" | "compute" | undefinedParameters
fPick<FuncDecl, 'stage' | 'attrs'>
Return value
'vertex' | 'fragment' | 'compute' | undefined
Description
The stage of a function declaration: 'vertex', 'fragment' or 'compute' for an
entry point, undefined for a helper. It reads the structured stage field first and
falls back to the attrs strings for a hand-built FuncDecl literal. Every stage
decision in the package (reflect, the capability gate, GLSL entry
classification, the roots of dead-function elimination) goes through this one
function.
See also
Source
src/core/ir/nodes.ts, line 888, at commit 26de7be8