IR

IR

export 40개

모든 백엔드가 읽는 중간 표현입니다. 노드와 문장과 선언이 들어 있고, 출력은 모두 여기서 나옵니다.

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

AddressSpace 타입
The BindingDecl.space a resource binding lives in: WGSL's var<uniform> or var<storage, ...>.
ALL_CAPABILITIES 상수
Every Capability, as a runtime value: the list a capability matrix, a doc generator or a coverage check iterates.
ASSEMBLED_AS 상수
Non-enumerable marker key on a FuncDecl: the name the declaration was last assembled under by module.
BindingDecl 인터페이스
A ModuleDecl.bindings entry: a resource bound at a slot.
BinOp 타입
The operator tag on Expr.binop: arithmetic (+ - * /), remainder (%) and bitwise.
Capability 타입
A GPU or language feature a target backend may or may not support.
CmpOp 타입
The operator tag on Expr.compare: the six relational operators.
ConstDecl 인터페이스
A ModuleDecl.consts entry: a module-scope constant.
DeclarableCapability 타입
The capabilities a module may name in ModuleDecl.enables: Capability minus the nine capabilities derived from the module's shape.
DiagnosticDirective 인터페이스
One WGSL diagnostic; directive.
EntryParam 인터페이스
An entry-point parameter: it carries a @builtin(...) or a @location(n).
Expr 타입
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.
ExternVarDecl 인터페이스
A host-provided global, the declaration behind externVar.
FuncDecl 인터페이스
A ModuleDecl.funcs entry: a WGSL/GLSL function, either an ordinary helper or a pipeline entry point (stage set).
grad 함수
Differentiate a function of a module with respect to one of its parameters, in forward mode, and add the derivative as a new function.
GradOptions 인터페이스
Options for grad.
GradResult 인터페이스
What grad returns: the module with the derivative function added, and its name.
installStmtSink 함수
Installs the statement sink that Node.assign() writes through.
isNodeValue 함수
Runtime type guard for "is this value a node".
lift 함수
Normalizes a NodeLike operand to a ReadonlyNode: a JS number becomes an f32 literal, and an existing node passes through unchanged.
LogOp 타입
The operator tag on Expr.logical: the short-circuiting boolean operators && and ||.
ModuleDecl 인터페이스
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.
ModuleVarDecl 인터페이스
One entry of ModuleDecl.vars: a module-scope variable that is not a resource.
Node 클래스
The write-capable node.
NODE_BRAND 상수
The symbol every node carries as a brand, installed once on the ReadonlyNode prototype.
OverrideDecl 인터페이스
A pipeline specialization constant, the declaration behind overrideConst.
RawPayload 타입
The argument to rawStmt: the wgsl and glsl source text of a raw statement.
RawStmt 타입
The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target.
ReadonlyNode 클래스
The read-only base of every value node: every literal, parameter, constRef and Let() binding is a ReadonlyNode.
renameVarrefsInFunc 함수
Renames variable references in the body of f.
rewriteExprsInFunc 함수
Applies rewrite to every expression in the body of f and returns the rewritten function.
SourceSpan 인터페이스
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.
sourceSpanOf 함수
The authored source span of an IR node, or undefined when it has none.
stageOf 함수
The stage of a function declaration: 'vertex', 'fragment' or 'compute' for an entry point, undefined for a helper.
Stmt 타입
Every statement shape the IR can hold: the ordered readonly Stmt[] that makes up a FuncDecl.body.
StructDecl 인터페이스
A ModuleDecl.structs entry: a WGSL struct declaration.
StructField 인터페이스
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.
WorkgroupShape 타입
The x, y and z extents of a compute entry's workgroup, WGSL's @workgroup_size(x, y, z).
workgroupShapeOf 함수
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.
workgroupSizeOf 함수
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.

이 페이지 편집 문제 보고