Skip to main content

PassTimers

Struct PassTimers 

Source
pub struct PassTimers { /* private fields */ }
Expand description

A ring of timestamp query sets, one per frame in flight plus two; see the module docs.

Implementations§

Source§

impl PassTimers

Source

pub fn new( device: &dyn Device, frames_in_flight: usize, max_passes: u32, ) -> Option<PassTimers>

Creates timers for up to max_passes passes across frames_in_flight frames, or None if the device has no timestamp queries.

max_passes is the sum of the MAX_PASSES of the renderers the frame runs, plus the caller’s own passes — see the module docs. A frame longer than it is timed as far as it goes.

None is not an error: the seam is explicit that timestamps degrade rather than break, and the caller’s answer is to pass None to CompiledGraph::execute and get an empty report.

The passes are counted as well when STATISTICS_VAR is 1; see PassTimers::counting.

Source

pub fn counting( device: &dyn Device, frames_in_flight: usize, max_passes: u32, ) -> Option<PassTimers>

PassTimers::new, counting each timed pass’s work whatever STATISTICS_VAR says: what a profiler that asks for the counts itself creates. On a device without Features::PIPELINE_STATISTICS_QUERY the passes are timed and not counted, as under the variable.

Source

pub fn latest(&self) -> &FrameTimings

The most recent frame whose timestamps have actually landed.

Empty until the ring has come round once.

Source

pub const fn capacity(&self) -> u32

How many passes these timers can bracket.

Source

pub fn destroy(&mut self, device: &dyn Device)

Releases the query sets. Call after the device is idle.

Trait Implementations§

Source§

impl Debug for PassTimers

Source§

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

Formats the value using the given formatter. Read more

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