Expand description
FlowGraph → WGSL code generation
Compiles @flow DAG blocks from CSS into executable WGSL shader modules.
Supports both fragment (rendering) and compute (simulation) targets.
The codegen pipeline:
- Collect which helper functions are needed (SDF, noise, etc.)
- Emit uniform/binding declarations
- Emit only the used helper functions
- Emit vertex shader (for fragment flows)
- Emit entry point with node computations in topological order
Functions§
- flow_
needs_ scene_ texture - Check if a flow graph uses the
sample_scene()function, which requires binding a scene texture to the pipeline. - flow_
to_ wgsl - Compile a validated FlowGraph into a complete WGSL module string.