pub struct Diag { /* private fields */ }Expand description
The render-side diagnostics state: the pure FrameStats, the gated clock,
the GPU-byte / draw-call figures, and the two flags that control collection
and the on-screen overlay.
Implementations§
Source§impl Diag
impl Diag
Sourcepub fn set_collecting(&mut self, on: bool)
pub fn set_collecting(&mut self, on: bool)
Enable or disable rolling frame-time collection (the gated clock read). Toggling resets the delta chain so a re-enable does not record a spurious long frame across the disabled gap.
Sourcepub fn collecting(&self) -> bool
pub fn collecting(&self) -> bool
Whether frame-time collection is currently enabled.
Sourcepub fn set_overlay(&mut self, on: bool)
pub fn set_overlay(&mut self, on: bool)
Enable or disable painting the on-screen overlay.
Sourcepub fn overlay_enabled(&self) -> bool
pub fn overlay_enabled(&self) -> bool
Whether the overlay should be painted this frame.
Sourcepub fn record_frame(&mut self)
pub fn record_frame(&mut self)
Record a presented frame. Reads the monotonic clock (only while collecting) and feeds the delta since the previous present to the stats.
Sourcepub fn record_dropped(&mut self)
pub fn record_dropped(&mut self)
Count a frame the renderer could not present. Breaks the delta chain so the next present’s delta excludes the skipped interval.
Sourcepub fn set_gpu_bytes(&mut self, bytes: u64)
pub fn set_gpu_bytes(&mut self, bytes: u64)
Set the core-tracked GPU resource byte estimate (fed from the render context each frame — dominated by the swapchain).
Sourcepub fn set_draw_calls(&mut self, n: u32)
pub fn set_draw_calls(&mut self, n: u32)
Set the draw/render-pass count issued on the last frame.
Sourcepub fn frame_ms_p50(&self) -> f32
pub fn frame_ms_p50(&self) -> f32
The current rolling snapshot.
Median frame time over the window, in milliseconds — the native-only
half of the frame-time pair (see FrameStats::frame_ms_p50).
Sourcepub fn set_analysis(&mut self, frame: &AnalysisFrame)
pub fn set_analysis(&mut self, frame: &AnalysisFrame)
Take this frame’s analysis snapshot. Called once per drawn frame from the
render seam, which is the one place that holds the AnalysisFrame.
Sourcepub fn analysis(&self) -> AnalysisMetrics
pub fn analysis(&self) -> AnalysisMetrics
The latest analysis snapshot — the native-only companion to
metrics. See AnalysisMetrics for why it is separate.
Sourcepub fn stats(&self) -> &FrameStats
pub fn stats(&self) -> &FrameStats
Read-only view of the rolling stats (the overlay reads this to draw the frame-time sparkline).