pub struct GpuTimer { /* private fields */ }Implementations§
Source§impl GpuTimer
impl GpuTimer
Sourcepub fn new(device: &Device, queue: &Queue, frames: u32) -> Option<Self>
pub fn new(device: &Device, queue: &Queue, frames: u32) -> Option<Self>
None when the device was created without Features::TIMESTAMP_QUERY.
Sourcepub fn next(&mut self, renderer: &mut Renderer)
pub fn next(&mut self, renderer: &mut Renderer)
Times the renderer’s next pass. Past the capacity the pass is not timed.
Sourcepub fn resolve(&mut self, renderer: &mut Renderer, encoder: &mut CommandEncoder)
pub fn resolve(&mut self, renderer: &mut Renderer, encoder: &mut CommandEncoder)
Stops timing and copies this run’s timestamps to Self::readback.
Sourcepub fn take_ms(&mut self) -> (f64, u32)
pub fn take_ms(&mut self) -> (f64, u32)
Sum of the timed passes in ms, read from the mapped Self::readback, which it unmaps.
Returns the number of passes too.
Auto Trait Implementations§
impl !RefUnwindSafe for GpuTimer
impl !UnwindSafe for GpuTimer
impl Freeze for GpuTimer
impl Send for GpuTimer
impl Sync for GpuTimer
impl Unpin for GpuTimer
impl UnsafeUnpin for GpuTimer
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
Mutably borrows from an owned value. Read more