Authoring
48 members
The builder a shader is written with: modules, functions, variables and control flow.
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
-
BreakFunction - Push a break; onto the innermost scope, exiting the nearest enclosing Loop outright, under the same nesting rule as Continue: an If nested inside the loop is not itself a break boundary.
-
BuilderClass - The statement collector every fn() body writes into.
-
CallFunction - Push a call as a statement onto the innermost scope, kept for its effect and nothing else.
-
compileFunction - Compile TypeShade TypeScript source into the module and generated shader outputs.
-
CompileOptionsInterface - How one compile() call is set up.
-
CompileResultInterface - What compile() returns.
-
compileTsSourceFunction - Compile a TypeScript source string through the TypeShade authoring pipeline.
-
CompileTsSourceOptionsInterface - Options controlling compilation of a TypeShade TypeScript source string.
-
CompileTsSourceResultInterface - The result of compiling a TypeShade TypeScript source string, including IR and optional WGSL.
-
condExprFunction - N-arm value dispatch on conditions, the first true condition winning: condExpr([[c0, () => e0], [c1, () => e1]], () => eN).
-
constExprFunction - Author a module-level constant from an IR value expression: the form for a constant that is not a plain scalar.
-
ConstExprDeclInterface - What constExpr returns: the ConstDecl itself, so it drops straight into module, carrying node, the typed reference to read the constant through at call sites.
-
ContinueFunction - Push a continue; onto the innermost scope, skipping to the next iteration of the nearest enclosing loop.
-
DiscardFunction - Push a discard; onto the innermost scope.
-
externFnFunction - Forward-declare a callable whose real definition (fn(...)) is authored somewhere else, or built later than the caller's own module-load time (see ExternFn).
-
ExternFnType - A typed call-only handle for a function whose definition is provided elsewhere: the forward-declaration counterpart to fn().
-
externVarFunction - Declare a host-provided global: the variable counterpart of externFn.
-
ExternVarHandleInterface - The pair externVar returns: the read node, and the declaration to hand module().
-
findUseTypeshadeDirectiveFunction - Scan the top-level statements of a SourceFile and return the first "use typeshade"; directive, or undefined if none is present.
-
fnFunction - Author a function. One call covers a plain helper and a @vertex, @fragment or @compute entry point.
-
FnHandleType - The type fn() returns: a typed, callable handle that is also a FuncDecl.
-
FnParamSpecType - The parameter record fn() accepts.
-
hasUseTypeshadeDirectiveFunction - True when the SourceFile contains at least one top-level "use typeshade".
-
IfFunction - Author if (cond) { body } over the innermost active scope.
-
IfChainClass - The chain object Builder.if and If(/api/if/) return, so .elif(...) and .else(...) read top to bottom in authored order.
-
ifExprFunction - Two-arm value dispatch on a condition: ifExpr(cond, () => a, () => b).
-
isTypeshadeSourceFunction - Return whether a TypeScript source string opts into TypeShade with the "use typeshade" directive.
-
isUseTypeshadeDirectiveFunction - Returns true when node is a top-level "use typeshade"; statement.
-
LetFunction - Bind a value to an immutable local, emitting let name = expr; into the innermost active scope.
-
LoopFunction - Author a C-style for loop over the innermost active scope.
-
matchEnumFunction - Exhaustive integer dispatch over an enumU32: matchEnum(kind, Kind, { Line: () => …, Fill: () => …, … }).
-
matchExprFunction - A typed multi-arm dispatch over a scalar scrutinee, the expression form of switch (scrutinee) { case v0: r0; …; default: dflt }.
-
moduleFunction - Assemble a module from its declarations.
-
ModulePartsInterface - The input shape module accepts: a Partial<ModuleDecl> whose funcs also takes a key-named record as an alternative to the array, and whose uses derives structs, bindings and consts from declarator handles.
-
overrideConstFunction - Declare a pipeline specialization constant: one value that is fixed when a pipeline is created, later than module build and earlier than the draw.
-
OverrideHandleInterface - The pair overrideConst returns for a pipeline specialization constant: .node reads the value, opaque to the optimizer, in any expression or branch condition, and .decl goes into module.
-
ParamSpecType - The parameter record externFn takes: a plain map from parameter name to ShaderType, in declaration order.
-
rawStmtFunction - Author a raw statement, the escape hatch that splices verbatim text into a function body.
-
reduceFunction - Fold a value over a C-style loop: the value-returning spelling of the var acc = init; for (...) { acc = f(acc, i) } accumulator.
-
ReturnFunction - Push an explicit return value; onto the innermost scope.
-
ReturnIfFunction - Guard clause: if (cond) { return value; }, the explicit early return that reads as "return value if cond".
-
SwitchFunction - Open a switch (scrut) chain: Switch(scrut).case(n, body)….default(body).
-
SwitchChainClass - switch (scrut) { case n: …; default: … } as a chainable statement builder, mirroring the If(…).elif(…).else(…) surface so integer dispatch reads the familiar imperative way: declare a Var(/api/var/) holding the default, then assign it inside the case arms.
-
TsCompilerDiagnosticInterface - A source diagnostic produced while TypeShade analyzes or compiles TypeScript shader code.
-
USE_TYPESHADEConstant - The exact string the directive must carry.
-
UsesHandleType - A declarator handle accepted by module({ uses }): anything that carries its own declaration or binding.
-
VarFunction - Declare a mutable local and return the node that reads and writes it.
-
whenFunction - Dispatch a value on a condition, returning the value instead of mutating a var.