Skip to content

Add render graph framework#76

Merged
brendancol merged 3 commits intomasterfrom
issue-73
Mar 6, 2026
Merged

Add render graph framework#76
brendancol merged 3 commits intomasterfrom
issue-73

Conversation

@brendancol
Copy link
Contributor

Closes #73

Summary

Render graph framework for #73 (Phase 2 roadmap). Lets you define render pipelines as a DAG of passes instead of managing buffer dependencies and execution order by hand in render().

What's included

  • RenderPass base class — typed buffer inputs/outputs per pass, optional capability requirements
  • RenderGraph container — pass registration, fallback wiring, compile-to-execute
  • Topological sort (Kahn's algorithm, stable tie-breaking by insertion order, cycle detection)
  • Buffer lifetime analysis — greedy interval colouring assigns pool slots, reuses GPU memory when lifetimes don't overlap
  • Capability gating — passes declare requirements (e.g. optix_denoiser); graph skips unavailable ones and wires fallbacks
  • Validation — missing inputs, cycles, fallback chain resolution

Not included (follow-up)

Concrete pass extractions (GBuffer, Shadow, AO, Denoise, Tonemap, Composite wrapping existing CUDA kernels) are deferred. This PR is the framework they'll plug into. render() and _update_frame() are unchanged.

Test plan

  • 38 unit tests across all framework components (topology, cycles, capability gating, fallbacks, lifetime analysis, execution, edge cases, realistic pipeline shape)
  • Example script runs on CPU with numpy, no GPU needed
  • Manual check that existing tests still pass (no changes to existing code paths)

Lightweight DAG of render passes with:
- RenderPass base class (inputs/outputs/requires declarations)
- RenderGraph container with topological sort and cycle detection
- Buffer lifetime analysis for GPU memory reuse
- Capability-gated pass skipping with fallback wiring
- Validation for missing inputs and dependency errors
API reference for BufferDesc, RenderPass, RenderGraph, CompiledGraph.
User guide section with worked example showing capability gating and fallbacks.
CPU-only demo showing custom passes, capability gating, fallback wiring,
and the full compile-then-execute workflow.
@brendancol brendancol merged commit aa33140 into master Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render graph: configurable DAG of render passes

1 participant