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
impl PassTimers
Sourcepub fn new(
device: &dyn Device,
frames_in_flight: usize,
max_passes: u32,
) -> Option<PassTimers>
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.
Sourcepub fn counting(
device: &dyn Device,
frames_in_flight: usize,
max_passes: u32,
) -> Option<PassTimers>
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.
Sourcepub fn latest(&self) -> &FrameTimings
pub fn latest(&self) -> &FrameTimings
The most recent frame whose timestamps have actually landed.
Empty until the ring has come round once.