작성

작성

export 48개

셰이더를 쓰는 빌더입니다. 모듈과 함수, 변수, 제어 흐름을 여기 있는 호출로 선언합니다.

시그니처, 설명, 예제는 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

Break 함수
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.
Builder 클래스
The statement collector every fn() body writes into.
Call 함수
Push a call as a statement onto the innermost scope, kept for its effect and nothing else.
compile 함수
Compile TypeShade TypeScript source into the module and generated shader outputs.
CompileOptions 인터페이스
How one compile() call is set up.
CompileResult 인터페이스
What compile() returns.
compileTsSource 함수
Compile a TypeScript source string through the TypeShade authoring pipeline.
CompileTsSourceOptions 인터페이스
Options controlling compilation of a TypeShade TypeScript source string.
CompileTsSourceResult 인터페이스
The result of compiling a TypeShade TypeScript source string, including IR and optional WGSL.
condExpr 함수
N-arm value dispatch on conditions, the first true condition winning: condExpr([[c0, () => e0], [c1, () => e1]], () => eN).
constExpr 함수
Author a module-level constant from an IR value expression: the form for a constant that is not a plain scalar.
ConstExprDecl 인터페이스
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.
Continue 함수
Push a continue; onto the innermost scope, skipping to the next iteration of the nearest enclosing loop.
Discard 함수
Push a discard; onto the innermost scope.
externFn 함수
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).
ExternFn 타입
A typed call-only handle for a function whose definition is provided elsewhere: the forward-declaration counterpart to fn().
externVar 함수
Declare a host-provided global: the variable counterpart of externFn.
ExternVarHandle 인터페이스
The pair externVar returns: the read node, and the declaration to hand module().
findUseTypeshadeDirective 함수
Scan the top-level statements of a SourceFile and return the first "use typeshade"; directive, or undefined if none is present.
fn 함수
Author a function. One call covers a plain helper and a @vertex, @fragment or @compute entry point.
FnHandle 타입
The type fn() returns: a typed, callable handle that is also a FuncDecl.
FnParamSpec 타입
The parameter record fn() accepts.
hasUseTypeshadeDirective 함수
True when the SourceFile contains at least one top-level "use typeshade".
If 함수
Author if (cond) { body } over the innermost active scope.
IfChain 클래스
The chain object Builder.if and If(/api/if/) return, so .elif(...) and .else(...) read top to bottom in authored order.
ifExpr 함수
Two-arm value dispatch on a condition: ifExpr(cond, () => a, () => b).
isTypeshadeSource 함수
Return whether a TypeScript source string opts into TypeShade with the "use typeshade" directive.
isUseTypeshadeDirective 함수
Returns true when node is a top-level "use typeshade"; statement.
Let 함수
Bind a value to an immutable local, emitting let name = expr; into the innermost active scope.
Loop 함수
Author a C-style for loop over the innermost active scope.
matchEnum 함수
Exhaustive integer dispatch over an enumU32: matchEnum(kind, Kind, { Line: () => …, Fill: () => …, … }).
matchExpr 함수
A typed multi-arm dispatch over a scalar scrutinee, the expression form of switch (scrutinee) { case v0: r0; …; default: dflt }.
module 함수
Assemble a module from its declarations.
ModuleParts 인터페이스
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.
overrideConst 함수
Declare a pipeline specialization constant: one value that is fixed when a pipeline is created, later than module build and earlier than the draw.
OverrideHandle 인터페이스
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.
ParamSpec 타입
The parameter record externFn takes: a plain map from parameter name to ShaderType, in declaration order.
rawStmt 함수
Author a raw statement, the escape hatch that splices verbatim text into a function body.
reduce 함수
Fold a value over a C-style loop: the value-returning spelling of the var acc = init; for (...) { acc = f(acc, i) } accumulator.
Return 함수
Push an explicit return value; onto the innermost scope.
ReturnIf 함수
Guard clause: if (cond) { return value; }, the explicit early return that reads as "return value if cond".
Switch 함수
Open a switch (scrut) chain: Switch(scrut).case(n, body)….default(body).
SwitchChain 클래스
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.
TsCompilerDiagnostic 인터페이스
A source diagnostic produced while TypeShade analyzes or compiles TypeScript shader code.
USE_TYPESHADE 상수
The exact string the directive must carry.
UsesHandle 타입
A declarator handle accepted by module({ uses }): anything that carries its own declaration or binding.
Var 함수
Declare a mutable local and return the node that reads and writes it.
when 함수
Dispatch a value on a condition, returning the value instead of mutating a var.

이 페이지 편집 문제 보고