feat(renderer): add frame graph and persistent texture pool #937

Merged
SakulFlee merged 1 commit from feat/renderer-phase-2 into main 2026-10-26 02:57:39 +00:00
Collaborator

Summary

Phase 2a: introduce the frame-graph backbone and a persistent texture pool. No visual change yet; the scene still renders directly to the surface target.

  • New orbital_render_graph crate:
    • Passes declare read/write resources and compile into a dependency order.
    • Per-pass CPU timings, debug_dump() and Graphviz to_dot() output.
    • Descriptor-keyed TexturePool reused across frames, with no aliasing within one frame.
  • Renderer now schedules shadow → prepare-world → sky → models through the graph.
  • The world bind group is prepared after the shadow pass as a graph pass, preserving the shadow-reallocation ordering fix.
  • The depth target comes from the texture pool instead of being recreated on resize.
  • Expose Renderer::render_graph_debug_dump() and render_graph_dot() for debug tooling.

This is the base for HDR + post-processing in the next phase: the graph already has a place for the scene target, tonemap and AA passes.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -p orbital_render_graph -p orbital_renderer -p orbital_app -- -D warnings
  • cargo test -p orbital_render_graph -p orbital_renderer -p orbital_app --no-fail-fast
  • cargo check -p template_minimal -p template_all_in_one -p template_2d
  • GUI examples were not launched in this environment (no display/GPU).

Refs #647, #781.

## Summary Phase 2a: introduce the frame-graph backbone and a persistent texture pool. No visual change yet; the scene still renders directly to the surface target. - New `orbital_render_graph` crate: - Passes declare read/write resources and compile into a dependency order. - Per-pass CPU timings, `debug_dump()` and Graphviz `to_dot()` output. - Descriptor-keyed `TexturePool` reused across frames, with no aliasing within one frame. - `Renderer` now schedules `shadow → prepare-world → sky → models` through the graph. - The world bind group is prepared after the shadow pass as a graph pass, preserving the shadow-reallocation ordering fix. - The depth target comes from the texture pool instead of being recreated on resize. - Expose `Renderer::render_graph_debug_dump()` and `render_graph_dot()` for debug tooling. This is the base for HDR + post-processing in the next phase: the graph already has a place for the scene target, tonemap and AA passes. ## Verification - `cargo fmt --all -- --check` - `cargo clippy -p orbital_render_graph -p orbital_renderer -p orbital_app -- -D warnings` - `cargo test -p orbital_render_graph -p orbital_renderer -p orbital_app --no-fail-fast` - `cargo check -p template_minimal -p template_all_in_one -p template_2d` - GUI examples were not launched in this environment (no display/GPU). Refs #647, #781.
feat(renderer): add frame graph and persistent texture pool
All checks were successful
Lint / lint (pull_request) Successful in 1m7s
PR / test (pull_request) Successful in 14m27s
Templates / templates (pull_request) Successful in 4m48s
82fa436895
Add orbital_render_graph: passes declare resource reads/writes, compile into a dependency order, execute with per-pass CPU timings, and expose debug dump/DOT output. The renderer now schedules shadow, bind-group preparation, sky and model passes through the graph.

Add a descriptor-keyed texture pool and move the depth target onto it, so render targets are reused across frames instead of being recreated.

No visual change: the scene still renders directly to the surface target.

Smart test results

Result: PASS

Scope: full workspace

Reason: workspace-level change: Cargo.lock

Elapsed: 10m 59s

Workflow run

Overall: 432 tests, 422 passed, 0 failed, 10 skipped

Nextest: 421 tests, 421 passed, 0 failed, 0 skipped
Doctests: 11 tests, 1 passed, 0 failed, 10 skipped

Outcome charts are split between nextest and doctests. The timing chart covers nextest only.

Crate Nextest Passed Failed Skipped Doctests Time
orbital 1 1 0 0 - 10.37s
orbital_2d 29 29 0 0 0/1 0.30s
orbital_app 10 10 0 0 0/1 0.08s
orbital_camera 4 4 0 0 - 0.04s
orbital_core 2 2 0 0 - 0.02s
orbital_debug_render 0 0 0 0 0/1 0.00s
orbital_debug_ui 45 45 0 0 0/1 0.39s
orbital_ecs 114 114 0 0 0/2 1.00s
orbital_ecs_bridge 39 39 0 0 - 0.37s
orbital_file_manager 5 5 0 0 - 0.44s
orbital_iced 25 25 0 0 - 0.20s
orbital_importer_gltf 13 13 0 0 - 0.18s
orbital_input 11 11 0 0 - 0.08s
orbital_light 6 6 0 0 - 0.05s
orbital_macros 0 0 0 0 0/1 0.00s
orbital_math 4 4 0 0 - 0.03s
orbital_procgeo 2 2 0 0 - 0.01s
orbital_render_graph 6 6 0 0 - 0.05s
orbital_renderer 3 3 0 0 - 0.02s
orbital_resources 18 18 0 0 - 3.27s
orbital_shader_core 0 0 0 0 1/1 0.00s
orbital_shader_preprocessor 12 12 0 0 - 0.08s
orbital_shadow 3 3 0 0 - 0.02s
orbital_text 14 14 0 0 0/1 0.39s
orbital_texture 9 9 0 0 - 0.05s
orbital_touch_ui 1 1 0 0 0/1 0.01s
orbital_ui 32 32 0 0 0/1 0.16s
orbital_world_environment 13 13 0 0 - 0.07s
pie showData
    title Nextest outcomes
    "Passed" : 421
pie showData
    title Doctest outcomes
    "Passed" : 1
    "Skipped" : 10
xychart-beta
    title "Slowest crates (nextest seconds)"
    x-axis ["orbital", "orbital_resources", "orbital_ecs", "orbital_file_manager", "orbital_text", "orbital_debug_ui", "orbital_ecs_bridge", "orbital_2d"]
    y-axis "Seconds" 0 --> 10.4
    bar [10.37, 3.27, 1.00, 0.44, 0.39, 0.39, 0.37, 0.30]
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** full workspace **Reason:** workspace-level change: Cargo.lock **Elapsed:** 10m 59s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/640) **Overall:** 432 tests, 422 passed, 0 failed, 10 skipped **Nextest:** 421 tests, 421 passed, 0 failed, 0 skipped **Doctests:** 11 tests, 1 passed, 0 failed, 10 skipped _Outcome charts are split between nextest and doctests. The timing chart covers nextest only._ | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital | 1 | 1 | 0 | 0 | - | 10.37s | | orbital_2d | 29 | 29 | 0 | 0 | 0/1 | 0.30s | | orbital_app | 10 | 10 | 0 | 0 | 0/1 | 0.08s | | orbital_camera | 4 | 4 | 0 | 0 | - | 0.04s | | orbital_core | 2 | 2 | 0 | 0 | - | 0.02s | | orbital_debug_render | 0 | 0 | 0 | 0 | 0/1 | 0.00s | | orbital_debug_ui | 45 | 45 | 0 | 0 | 0/1 | 0.39s | | orbital_ecs | 114 | 114 | 0 | 0 | 0/2 | 1.00s | | orbital_ecs_bridge | 39 | 39 | 0 | 0 | - | 0.37s | | orbital_file_manager | 5 | 5 | 0 | 0 | - | 0.44s | | orbital_iced | 25 | 25 | 0 | 0 | - | 0.20s | | orbital_importer_gltf | 13 | 13 | 0 | 0 | - | 0.18s | | orbital_input | 11 | 11 | 0 | 0 | - | 0.08s | | orbital_light | 6 | 6 | 0 | 0 | - | 0.05s | | orbital_macros | 0 | 0 | 0 | 0 | 0/1 | 0.00s | | orbital_math | 4 | 4 | 0 | 0 | - | 0.03s | | orbital_procgeo | 2 | 2 | 0 | 0 | - | 0.01s | | orbital_render_graph | 6 | 6 | 0 | 0 | - | 0.05s | | orbital_renderer | 3 | 3 | 0 | 0 | - | 0.02s | | orbital_resources | 18 | 18 | 0 | 0 | - | 3.27s | | orbital_shader_core | 0 | 0 | 0 | 0 | 1/1 | 0.00s | | orbital_shader_preprocessor | 12 | 12 | 0 | 0 | - | 0.08s | | orbital_shadow | 3 | 3 | 0 | 0 | - | 0.02s | | orbital_text | 14 | 14 | 0 | 0 | 0/1 | 0.39s | | orbital_texture | 9 | 9 | 0 | 0 | - | 0.05s | | orbital_touch_ui | 1 | 1 | 0 | 0 | 0/1 | 0.01s | | orbital_ui | 32 | 32 | 0 | 0 | 0/1 | 0.16s | | orbital_world_environment | 13 | 13 | 0 | 0 | - | 0.07s | ```mermaid pie showData title Nextest outcomes "Passed" : 421 ``` ```mermaid pie showData title Doctest outcomes "Passed" : 1 "Skipped" : 10 ``` ```mermaid xychart-beta title "Slowest crates (nextest seconds)" x-axis ["orbital", "orbital_resources", "orbital_ecs", "orbital_file_manager", "orbital_text", "orbital_debug_ui", "orbital_ecs_bridge", "orbital_2d"] y-axis "Seconds" 0 --> 10.4 bar [10.37, 3.27, 1.00, 0.44, 0.39, 0.39, 0.37, 0.30] ```
SakulFlee deleted branch feat/renderer-phase-2 2026-10-26 02:57:51 +00:00
Sign in to join this conversation.
No description provided.