Skip to main content

FramePasses

Struct FramePasses 

Source
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: Duration

GPU/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: Duration

Swapchain-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: Duration

Blit + 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

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FramePasses

Source§

impl Debug for FramePasses

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FramePasses

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for FramePasses

Source§

impl PartialEq for FramePasses

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FramePasses

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.