Damage, Effects, and Caching
Reduce repaint work while preserving the pixels required by compositing effects and each target image’s history.
When a scene changes, the renderer needs to determine which pixels in its destination image no longer represent that scene. This calculation is called damage tracking. It reduces repaint work, but its first responsibility is correctness: omitting a required region can leave stale pixels even when the changed node itself has been redrawn.
Destination Image History
The destination image matters because a multi-buffered output can acquire storage containing a frame older than the one most recently displayed. Hera therefore maintains accepted content history for each target and compares the new scene with that target's own history when planning its repaint.
A failed GPU submission does not advance the accepted damage snapshot. Otherwise a later retry could incorrectly assume that pixels from failed work were already present.
Effect Input Dependencies
Compositing effects add dependencies to that comparison. A blur needs samples beyond its output bounds, and a backdrop effect reads pixels painted earlier in the scene. An isolated group may introduce an offscreen target as well, so the planner must account for both the group's inputs and its eventual composition into the main image.
Planning keeps coordinates explicit: damage and scissors begin in framebuffer space, group encoding rebases them to a local target, and downsampled blur images have their own extents. A clear defines the attachment area it opens; a loaded composite restricts writes to its output region.
Conservative Culling
Culling uses the same dependency information to decide whether covered content can be skipped. If an effect still reads the content, opaque coverage does not make its draw unnecessary. When entries can be removed, the planner compacts group membership and draw indices together while preserving paint order.
Completed Content Reuse
The renderer can retain eligible runs of completed pixels in a bounded cache. Cache plans remain optional: if their graph exceeds admission budgets, the renderer retries the ordinary plan. A cache miss or rejected optimization must preserve the same visible result.
Imported image content supplies another source of change information through FrameDamage. It describes differences between complete immutable buffer imports, allowing the server to reason about changed image pixels. Scene-level tracking must still account for how those pixels are placed, filtered, and composed with the rest of the scene.
See render graph internals and buffer imports.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/renderer/src/vulkan/scene/planning/damage.rscrates/renderer/src/vulkan/scene/planning/groups.rscrates/renderer/src/vulkan/scene/renderer/admission.rscrates/renderer/src/vulkan/scene/run_cache.rs