IR
40 members
The intermediate representation every backend reads: nodes, statements and declarations.
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
-
AddressSpaceType - The BindingDecl.space a resource binding lives in: WGSL's var<uniform> or var<storage, ...>.
-
ALL_CAPABILITIESConstant - Every Capability, as a runtime value: the list a capability matrix, a doc generator or a coverage check iterates.
-
ASSEMBLED_ASConstant - Non-enumerable marker key on a FuncDecl: the name the declaration was last assembled under by module.
-
BindingDeclInterface - A ModuleDecl.bindings entry: a resource bound at a slot.
-
BinOpType - The operator tag on Expr.binop: arithmetic (+ - * /), remainder (%) and bitwise.
-
CapabilityType - A GPU or language feature a target backend may or may not support.
-
CmpOpType - The operator tag on Expr.compare: the six relational operators.
-
ConstDeclInterface - A ModuleDecl.consts entry: a module-scope constant.
-
DeclarableCapabilityType - The capabilities a module may name in ModuleDecl.enables: Capability minus the nine capabilities derived from the module's shape.
-
DiagnosticDirectiveInterface - One WGSL diagnostic; directive.
-
EntryParamInterface - An entry-point parameter: it carries a @builtin(...) or a @location(n).
-
ExprType - Every expression shape the IR can hold: the closed set that Node and ReadonlyNode build and that the WGSL, GLSL and CPU backends walk to emit or evaluate.
-
ExternVarDeclInterface - A host-provided global, the declaration behind externVar.
-
FuncDeclInterface - A ModuleDecl.funcs entry: a WGSL/GLSL function, either an ordinary helper or a pipeline entry point (stage set).
-
gradFunction - Differentiate a function of a module with respect to one of its parameters, in forward mode, and add the derivative as a new function.
-
GradOptionsInterface - Options for grad.
-
GradResultInterface - What grad returns: the module with the derivative function added, and its name.
-
installStmtSinkFunction - Installs the statement sink that Node.assign() writes through.
-
isNodeValueFunction - Runtime type guard for "is this value a node".
-
liftFunction - Normalizes a NodeLike operand to a ReadonlyNode: a JS number becomes an f32 literal, and an existing node passes through unchanged.
-
LogOpType - The operator tag on Expr.logical: the short-circuiting boolean operators && and ||.
-
ModuleDeclInterface - The whole-shader unit: everything a backend needs to emit a complete WGSL or GLSL ES 3.00 module, or to evaluate one on the CPU oracle.
-
ModuleVarDeclInterface - One entry of ModuleDecl.vars: a module-scope variable that is not a resource.
-
NodeClass - The write-capable node.
-
NODE_BRANDConstant - The symbol every node carries as a brand, installed once on the ReadonlyNode prototype.
-
OverrideDeclInterface - A pipeline specialization constant, the declaration behind overrideConst.
-
RawPayloadType - The argument to rawStmt: the wgsl and glsl source text of a raw statement.
-
RawStmtType - The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target.
-
ReadonlyNodeClass - The read-only base of every value node: every literal, parameter, constRef and Let() binding is a ReadonlyNode.
-
renameVarrefsInFuncFunction - Renames variable references in the body of f.
-
rewriteExprsInFuncFunction - Applies rewrite to every expression in the body of f and returns the rewritten function.
-
SourceSpanInterface - Where an IR node came from in its authored source: the file, the exact UTF-16 offsets, and the line and character of each end for display.
-
sourceSpanOfFunction - The authored source span of an IR node, or undefined when it has none.
-
stageOfFunction - The stage of a function declaration: 'vertex', 'fragment' or 'compute' for an entry point, undefined for a helper.
-
StmtType - Every statement shape the IR can hold: the ordered readonly Stmt[] that makes up a FuncDecl.body.
-
StructDeclInterface - A ModuleDecl.structs entry: a WGSL struct declaration.
-
StructFieldInterface - One field of a StructDecl: a plain data member of a uniform or storage struct, or, in a vertex/fragment I/O struct, a member carrying a @builtin or @location attribute.
-
WorkgroupShapeType - The x, y and z extents of a compute entry's workgroup, WGSL's @workgroup_size(x, y, z).
-
workgroupShapeOfFunction - The workgroup shape of a compute entry: the structured workgroupShape field first, then [workgroupSize, 1, 1], then the extents of the @workgroup_size(x, y, z) attribute string; undefined when none is present.
-
workgroupSizeOfFunction - The x workgroup size of a compute entry: the structured workgroupSize field first, then the @workgroup_size(n) attribute string; undefined when neither is present.