Skip to content

Add lightweight render pass orchestration (render graph) and shell integration - #16

Merged
ercmine merged 1 commit into
mainfrom
codex/implement-render-graph-pass-system
Apr 6, 2026
Merged

Add lightweight render pass orchestration (render graph) and shell integration#16
ercmine merged 1 commit into
mainfrom
codex/implement-render-graph-pass-system

Conversation

@ercmine

@ercmine ercmine commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The renderer had grown many ad-hoc stages (shadows, main lit, post, UI, debug, VFX) and required an explicit, inspectable, engine-owned pass orchestration layer.
  • Implement a practical, extensible frame composition model that makes pass order, resource producers/consumers, and dependencies first-class and testable without introducing an enormous AAA scheduler.

Description

  • Added a lightweight render-pass registry with explicit resources, pass definitions, execute/enable hooks, execution context, diagnostics, and a textual dump_graph() in engine/render/render_pass_system.hpp and engine/render/render_pass_system.cpp.
  • Implemented validation and ordering logic that checks for duplicate names, missing dependencies/resources, write conflicts, read-without-producer (unless imported), and cycle detection and resolves a deterministic topological execution order using declared depends_on plus inferred producer→consumer edges.
  • Introduced an explicit resource model (RenderResourceDesc) supporting RenderTarget, DepthTarget, ShadowMap, PostProcessTexture, UiTarget, and imported Backbuffer, and a resource-usage model (RenderPassResourceUsage) with Read/Write/ReadWrite intents.
  • Integrated the pass system into the runtime shell (engine/shell/main.cpp) so the frame is now assembled through named passes: shadow-pass, main-lit-pass, bloom-extract-pass, bloom-blur-pass, bloom-composite-pass, outline-pass, ui-pass, debug-pass, and present-pass, including declared resources and explicit dependencies.
  • Wire-in per-pass CPU timing into existing debug tooling via RendererPassTiming and track active/inactive passes via RenderPassDiagnostics.
  • Added unit coverage in tests/render/render_pass_system_tests.cpp validating pass registration, execution ordering, enable/disable behavior, missing-producer detection, and cycle detection.
  • Updated build files and docs: added the new sources to the render_renderer library, added the render_render_pass_system_tests target and CTest entry, and documented the system and current frame layout in docs/rendering.md and engine/render/README.md.

Files created or updated (high level): engine/render/render_pass_system.hpp, engine/render/render_pass_system.cpp, tests/render/render_pass_system_tests.cpp, engine/shell/main.cpp, CMakeLists.txt, docs/rendering.md, engine/render/README.md.

Testing

  • Added a unit test target render_render_pass_system_tests which exercises ordering, validation, enable/disable behavior, and cycle detection and is intentionally deterministic and headless; the test source lives at tests/render/render_pass_system_tests.cpp.
  • Attempted to configure and build with cmake --preset linux-debug and cmake --build --preset linux-debug --target render_render_pass_system_tests render_shell; configuration/build failed in this environment due to unresolved external dependencies (SDL3 and bgfx/bx/bimg), so the new unit test was not executed here.

Codex Task

@ercmine
ercmine merged commit d70ea14 into main Apr 6, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant