Render Graph Internals
Declare passes and resource dependencies before recording GPU work, and retire transient storage only after completion.
Once scene evaluation produces a draw plan, the renderer describes its execution as a graph of image operations and passes. That graph brings together repaint regions, isolated groups, blur chains, and final composition so their resource dependencies can be resolved before GPU commands are recorded.
Planning and Execution
SceneRenderer coordinates scene evaluation, damage history, admission, resource preparation, graph compilation, and recording. The borrowed graph builder receives planning data and resource handles; it does not own Vulkan queue execution or the entire renderer.
Submission and retirement remain with the Vulkan backend, while the runtime coordinates output slots and display dependencies. This separation lets pass-building helpers describe the work they need without taking ownership of the device or determining how long scanout storage stays alive.
Render Plan Admission
Graph admission happens before glyph preparation and instance/descriptor growth. Optional retained-run plans can retry without caching, then split-damage plans can fall back to ordinary repaint bounds when required by budgets.
Fallback must preserve visible results. An optimization may change how much work executes, but it cannot discard an input required by a filter or backdrop reader.
Intermediate Targets
Graph construction begins by importing the destination image and emitting segments in paint order. An isolated group introduces a local offscreen target that will later be composited back into that sequence. Blur chains add scratch images and sampling dependencies, including the larger input regions required by convolution.
Compilation resolves hazards and transient resources from those declarations. Recording uses prepared tables, instances, descriptors, and glyph data through a frame context.
Coordinate Spaces
The coordinate space changes as work moves into intermediate targets. Scene bounds and scissors start in framebuffer coordinates, then group encoding rebases them to a local target origin. Downsampled targets also change pixel extent, so shape metrics, transforms, and scissors must agree on the destination being recorded.
A clear affects its declared attachment region, while loaded composition restricts writes to a clamped output region. Confusing those scopes can overwrite pixels outside damage.
Completed Work Retirement
A compiled graph stays alive with its command-buffer slot until the submitted work completes. At that point, transient images can return to the pool and descriptor storage can be reset; eligible completed runs can also enter the bounded retained cache. These GPU completion rules govern command resources without releasing images still owned by scanout.
GPU completion still does not free an active scanout image. Output lifetime remains governed by presentation and synchronization.
Source Reference
For the optimization inventory, eligibility rules, defaults, and implementing lines, see Renderer Optimizations.
The following files in the Hera checkout define the behavior described on this page.
crates/renderer/src/vulkan/graph/work.rscrates/renderer/src/vulkan/scene/passes/mod.rscrates/renderer/src/vulkan/scene/renderer.rscrates/renderer/src/vulkan/scene/renderer/resources.rs