Bounded ring of aligned UI, worker, profiler, and presentation-memory samples. More...
#include "donner/editor/ViewportInteractionController.h"
Public Member Functions | |
| void | push (float ms) |
| Append a new frame sample. The matching backendMs[] slot is reset to 0 ("no worker result this frame"); setLatestBackendMs fills it in if a render result lands during the same UI frame. | |
| void | setLatestBackendMs (float ms) |
| Record an async-renderer worker timing for the most recently pushed frame. Called by RenderCoordinator::pollRenderResult when a new RenderResult arrives. No-op if no frame has been pushed yet. Also updates lastBackendMs so UI elements that want to show the latest measured worker latency have a persistent value. | |
| void | setLatestFrameCost (const FrameCostBreakdown &cost) |
| Record the editor render-cost breakdown for the most recently pushed frame. No-op if no frame has been pushed yet. | |
| void | setLatestMemorySample (const FrameMemorySample &sample) |
| Record presentation-memory counters for the most recently pushed frame. No-op if no frame has been pushed yet. | |
| FrameMemorySample | latestNonZeroMemorySample () const |
| Return the newest non-zero presentation-memory sample, or zeroes if none exist. | |
| float | latest () const |
| Return the latest UI-frame duration in milliseconds, or zero when empty. | |
| float | latestBackend () const |
| Return the async worker timing that landed on the newest frame, or zero. | |
| float | max () const |
| Return the largest retained UI-frame duration in milliseconds, or zero when empty. | |
Public Attributes | |
| std::array< float, kFrameHistoryCapacity > | deltaMs {} |
| ImGui frame delta per UI-thread frame - populated from ImGui::GetIO().DeltaTime by noteFrameDelta. | |
| std::array< float, kFrameHistoryCapacity > | backendMs {} |
| Async-renderer worker/presentation latency (ms) per UI frame, aligned 1:1 with the matching deltaMs[] slot. Holds 0.0f for frames where no render result landed (the worker was still busy or nothing was requested); consumers skip zero entries so the graph doesn't drop to zero between drags. | |
| std::array< FrameProfilerSample, kFrameHistoryCapacity > | profiler {} |
| Known frame-cost divisions drawn as the color-bar profiler. | |
| std::array< FrameMemorySample, kFrameHistoryCapacity > | memory {} |
| Presentation memory retained by the editor texture cache. | |
| std::size_t | writeIndex = 0 |
| Ring slot that receives the next frame sample. | |
| std::size_t | samples = 0 |
| Number of valid samples currently retained, bounded by capacity. | |
| float | lastBackendMs = 0.0f |
| Most recent non-zero worker sample, so latched-worker-latency readers (the numeric readout, sticky-line rendering) have something to show between render-result landings. | |
Bounded ring of aligned UI, worker, profiler, and presentation-memory samples.