pub struct FramePasses {
pub rebuild: Duration,
pub layout: Duration,
pub paint: Duration,
pub encode: Duration,
pub acquire: Duration,
pub submit: Duration,
pub skipped: bool,
pub gpu: Option<GpuPasses>,
}Expand description
One frame’s measured pass durations, as recorded by a shell’s frame
callback (AndroidAppHandle::frame / frust_render_frame /
desktop’s RedrawRequested handler — see docs/ARCHITECTURE.md’s Frame
pipeline). skipped is set by the mobile dirty-gate for a
frame whose passes never ran; its pass durations are Duration::ZERO in
that case and it is excluded from the percentile computation in
FrameStats::summary (see that method’s docs) while still counting
toward total_frames/skipped_frames.
Fields§
§rebuild: Duration§layout: Duration§paint: Duration§encode: DurationGPU/CPU encode cost — the SurfaceRenderer::encode span
(vello encode + render_to_texture, or the CPU rasterize+upload),
with no swapchain-acquire wait folded in. Split out from the old
combined encode_present so encode work and the vsync/
present wait are separately attributable — the number the
render-thread-split GO/NO-GO decision is made on.
acquire: DurationSwapchain-acquire cost — the SurfaceRenderer::acquire span,
dominated by the blocking vsync wait (per the surface’s present mode).
Split out from the old combined present so the blocking
vsync wait is attributable separately from the blit/submit work below —
the S5 GPU-saturation-vs-blit-cost question. acquire + submit equals the
old v2 present span, so cross-baseline math is unchanged.
submit: DurationBlit + queue-submit + present cost — the SurfaceRenderer::submit
span, the GPU/driver work after the swapchain texture is acquired. See
Self::acquire for the split rationale.
skipped: bool§gpu: Option<GpuPasses>This frame’s real GPU time per pass, when the renderer measured it —
see GpuPasses. None is the ordinary case and is what the raw line
reports as gpu_q=0.
Deliberately outside Self::total: GPU passes run concurrently
with the CPU spans above, so adding them would double-count the frame.
It is also not carried by RenderSpans — a shell attaches it with
Self::with_gpu after folding its two measured halves together,
which keeps the split’s own reassembly about the spans it measured.
Implementations§
Source§impl FramePasses
impl FramePasses
Sourcepub fn total(&self) -> Duration
pub fn total(&self) -> Duration
The sum of all six pass durations — the frame’s total wall time.
The GPU spans in Self::gpu are deliberately excluded; see that
field.
Sourcepub fn with_gpu(self, gpu: GpuPasses) -> Self
pub fn with_gpu(self, gpu: GpuPasses) -> Self
Attaches this frame’s measured GPU pass times.
A builder rather than a field on RenderSpans: every shell already
builds its RenderSpans by struct literal, and the GPU reading is
optional per frame and per tier, so FramePasses::from_split(ui, render).with_gpu(gpu) adds it without touching the spans a shell
measured itself.
Sourcepub fn from_split(ui: UiSpans, render: RenderSpans) -> Self
pub fn from_split(ui: UiSpans, render: RenderSpans) -> Self
Recombine a render-thread-split frame’s two half-measurements into the
one FramePasses the single emitter records.
In the render-thread split the UI thread measures
rebuild/layout/paint (UiSpans) while the render thread measures
encode/acquire/submit (RenderSpans); the UI half rides across
the scene-handoff channel
(SceneFrame) so the render thread —
the single emitter — can fold both halves into one frame record.
This is a pure reassembly of the existing six fields: it changes no
wire format (the raw v3 line [format_raw_frame_line] emits is byte-for-
byte identical to a single-thread frame’s), it only moves where each
span is measured. The skipped flag comes from the UI half (the frame
gate is UI-side — see crate::frame_gate).
Trait Implementations§
Source§impl Clone for FramePasses
impl Clone for FramePasses
impl Copy for FramePasses
Source§impl Debug for FramePasses
impl Debug for FramePasses
Source§impl Default for FramePasses
impl Default for FramePasses
impl Eq for FramePasses
Source§impl PartialEq for FramePasses
impl PartialEq for FramePasses
impl StructuralPartialEq for FramePasses
Auto Trait Implementations§
impl Freeze for FramePasses
impl RefUnwindSafe for FramePasses
impl Send for FramePasses
impl Sync for FramePasses
impl Unpin for FramePasses
impl UnsafeUnpin for FramePasses
impl UnwindSafe for FramePasses
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Brush for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.