Compiler API reference
Every export of the typeshade package, generated from the compiler at commit af54ddad5. One page per function, type, interface and class.
This API is for host applications and the fn() builder. Shader authors can use the language reference.
- Authoring 48 members
- The builder a shader is written with: modules, functions, variables and control flow.
- Builtins 96 members
- IR builder functions for math, vector and texture operations. Each returns an IR node. A shader file calls the builtins that the language reference lists.
- Values 15 members
- Literals, typed references and the constructors that turn a JavaScript value into a node.
- Types 85 members
- The type keys and type descriptors the authoring surface is typed by.
- IR 43 members
- The intermediate representation every backend reads: nodes, statements and declarations.
- Layout 24 members
- The declarators that state a struct or a bound resource once, for the host and both targets.
- Emit 30 members
- The WGSL and GLSL ES 3.00 writers, module fragments and the passes that run before them.
- Reflection 27 members
- What
reflect()recovers from a module: bind groups, byte layouts and entry points. - CPU oracle 10 members
- The CPU backend that runs a module in
f64and gives the reference values to compare against. - Console 8 members
- What a shader says through console.log: the events the CPU delivers, and the decoder for the ones the GPU records.
- Runtime 92 members
- The program runtime that runs compiled programs on WebGPU, the array a kernel call keeps on the device, and the host types a host view spells values with.
- Diagnostics 5 members
- The coded error class and the validation gate every emit goes through.
- Emulated f64 10 members
- Double precision on targets that have none, carried in pairs of
f32lanes. - Variants 17 members
- Feature axes as one family of modules, compiled and linked point by point.
- Backends 30 members
- The backend contract, the capability model and the registry that spells an intrinsic.
- Tooling 20 members
- Registry generation, semantic comparison, emit identity and size measurement.
- Editor 12 members
- What an editor asks the compiler for: diagnostics, completion and hover, at a source position.