Expand description
Slang code generation for fused kernels.
A kernel is generated from a small expression tree (SpecNodes). Each
node calls its op function from shaders/lib.slang; warps change the
context their input is evaluated in, so a shape under a transform is
evaluated analytically at the transformed position instead of being
rasterized and resampled.
Param offsets are baked into the code and depend only on structure, so a param edit never changes the code and never triggers a compile.
Modules§
- feedback_
params - Param layout of a
feedbackstep kernel (after the 4-float header, whose [1] is the state texel size in frame px).
Structs§
- Generated
- RunLayer
- RunLayout
- A run of layers as the packer writes it each frame: the blocks of the
layers showing then (
[kind][composite params][guard rect][layer],stridefloats each), after everything else in the params. - Spec
Node
Enums§
Constants§
- ENTRY
- Name every generated kernel entry point is emitted with. The compiler renames it to a unique symbol per kernel key.
- LIBRARY
- Op library prepended to every generated module.
Functions§
- entry_
name - Renames the generated entry point to a unique symbol.
- feedback
- Kernel for one step of a
feedbacknode:update(pos, px)from the agent’s code, with the previous state (T0) and up to four placed inputs (T1..T4), and the code’s constant tables after the params when it has them. Returns (key, body). - generate
- Generates the kernel for
spec, rooted at noderoot. - module
- Assembles a compile unit: the op library plus each kernel body with its entry point and module-level names made unique.
- single_
op - Generates the standalone single-op kernel for
def(tier 0): all inputs are textures. Returns None for ops without one (blur, custom shaders).