Skip to main content

GpuPasses

Struct GpuPasses 

Source
pub struct GpuPasses {
    pub prepass: Duration,
    pub main: Duration,
    pub composite: Duration,
    pub blit: Duration,
}
Expand description

One frame’s real GPU time, split by the spans the frust-owned render engine names — the counterpart of the CPU spans in FramePasses, measured on the GPU’s own clock rather than inferred from CPU wall time around a submit.

Produced only in a build whose device asked for GPU timestamps; every other frame carries None and reports gpu_q=0. A span may legitimately read zero — a frame with no off-screen layer does no composite work — so a zero is a measurement, not a gap.

Fields§

§prepass: Duration

Work recorded ahead of the frame’s own passes (the glyph-atlas replay).

§main: Duration

The frame’s own surface passes: clear, opaque strips, alpha strips, and the hole punch.

§composite: Duration

Off-screen layer pages and filter passes.

§blit: Duration

The present-side conversion or blit into the swapchain.

Implementations§

Source§

impl GpuPasses

Source

pub fn main_is_measured(&self) -> bool

Whether the main span carries a real measurement.

Every submitted frame records its opening surface pass into main, and a measured timestamp pair is strictly increasing, so a measured main is never exactly Duration::ZERO. A zero here therefore means the pair was never resolved (a clear-only opening pass that drew nothing has no valid pair on Metal), not that the pass took no time. The other three spans may legitimately be zero (a frame with no off-screen layer does no composite work), so only main can be judged this way.

Source

pub fn total(&self) -> Duration

The sum of the four spans — the frame’s attributed GPU pass time.

Queue and driver gaps between passes belong to no pass and are not folded in, so this is a lower bound on the frame’s whole GPU cost rather than an estimate of it.

Trait Implementations§

Source§

impl Clone for GpuPasses

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 GpuPasses

Source§

impl Debug for GpuPasses

Source§

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

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

impl Default for GpuPasses

Source§

fn default() -> Self

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

impl Eq for GpuPasses

Source§

impl PartialEq for GpuPasses

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 GpuPasses

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.