Skip to main content

FrameTimings

Struct FrameTimings 

Source
pub struct FrameTimings {
    pub passes: Vec<PassTiming>,
    pub frame: u64,
    pub elapsed_nanos: Option<u64>,
}
Expand description

A whole frame’s per-pass costs.

Fields§

§passes: Vec<PassTiming>

One entry per pass, in execution order.

§frame: u64

Which frame these came from — a few frames behind the one being recorded; see the module docs.

§elapsed_nanos: Option<u64>

Elapsed interval from the earliest measured pass start to the latest measured pass end. Includes gaps/contention, but not untimed work before or after those boundaries. None means the timestamps were incomplete or invalid; it must not be replaced with a sum of overlapping spans.

Implementations§

Source§

impl FrameTimings

Source

pub fn total_nanos(&self) -> u64

The sum of every pass’s elapsed span.

This double-counts overlapping stages and includes scheduling gaps. It is neither frame duration nor active GPU time. See elapsed_nanos for the outer measured interval.

Source

pub fn is_empty(&self) -> bool

Whether anything was measured at all.

Source

pub fn report(&self) -> String

The report, as text.

The other half of the graph’s “explain itself” obligation: the dump says what the frame is and this says what it cost.

Trait Implementations§

Source§

impl Clone for FrameTimings

Source§

fn clone(&self) -> FrameTimings

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 Debug for FrameTimings

Source§

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

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

impl DebugModule for FrameTimings

The renderer’s contribution to the debug overlay.

The UI plan’s first profiler surface (debug item 1 in docs/notes/tooling.md) was “stage 2/3 GPU pass timestamps”; this is the adapter that puts them there. It lives here, not in crcbl-ui, because the overlay is not allowed to know that a render pass exists — the module is contributed by the system it reports on. crcbl-render already depends on crcbl-ui (it owns the UI pass), so this is the direction the dependency already runs.

Every row is a number PassTimers resolved from a timestamp query. No row is derived from anything else, and there is no CPU number here: this struct measures the GPU and says so.

Source§

fn debug_section(&self, out: &mut DebugSection)

Writes this system’s title and rows into out.
Source§

impl Default for FrameTimings

Source§

fn default() -> FrameTimings

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

impl Eq for FrameTimings

Source§

impl PartialEq for FrameTimings

Source§

fn eq(&self, other: &FrameTimings) -> 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 FrameTimings

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

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> 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.