Skip to content

rendering: reuse unchanged retained frames - #68

Open
tritao wants to merge 2 commits into
stack/render-performance-infrastructurefrom
stack/render-performance-instrumentation
Open

rendering: reuse unchanged retained frames#68
tritao wants to merge 2 commits into
stack/render-performance-infrastructurefrom
stack/render-performance-instrumentation

Conversation

@tritao

@tritao tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Builds on #67.

Purpose

The first retained-renderer path still traversed the scene graph, rebuilt the
draw list and render plan, and revalidated backend resources on every frame,
even when nothing relevant had changed. That made a steady viewport pay most
of the same CPU cost as a newly constructed frame.

This PR gives SoRenderManager an unchanged-frame reuse path. When the scene,
camera, viewport, and other retained inputs are still valid, the manager can
execute the existing draw list and plan instead of rebuilding them.

What changed

  • Reuse an unchanged retained frame and its validated backend resources.
  • Keep forced rebuilding available for correctness checks and direct
    before/after benchmark comparisons.
  • Add opt-in timing for traversal, DrawList construction, planning, backend
    preparation and submission, GPU completion, selection, picking, and the
    total frame.
  • Report phases separately in benchmark JSON so moving work between phases
    cannot look like a free optimization.

Safety and scope

Reuse is conditional on the retained inputs remaining valid; otherwise the
normal construction path runs. Timing is disabled by default and no
wall-clock threshold is added to ordinary CI.

This layer handles whole-frame reuse only. Incremental mutation and interaction
optimizations are introduced later in the stack.

Validation

  • Steady-state reuse compared with explicitly forced rebuilding.
  • Renderer phase counters confirm that eligible frames skip construction and
    planning work.
  • Existing visual, picking, and selection results remain unchanged.

@tritao tritao changed the title stack/render performance instrumentation rendering: profile and optimize retained performance Aug 21, 2026
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 6cc3ad8 to f8c4874 Compare August 22, 2026 15:57
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 657eae6 to e8268c1 Compare August 22, 2026 18:57
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 448a442 to d3f509d Compare August 23, 2026 01:44
@tritao tritao changed the title rendering: profile and optimize retained performance rendering: reuse unchanged retained frames Aug 23, 2026
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 144d18f to 5b537db Compare August 23, 2026 03:19
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch from 5b537db to 3c03f3a Compare August 23, 2026 09:33
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 70bee8e to b058988 Compare August 23, 2026 11:13
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch 2 times, most recently from 1ee4895 to ec27e4f Compare August 23, 2026 13:14
@tritao
tritao force-pushed the stack/render-performance-instrumentation branch from ec27e4f to 44c1e48 Compare August 23, 2026 21:21
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.

1 participant