pub struct FrameTimestamps<'a> { /* private fields */ }Expand description
The per-frame timestamp sink the renderer records its pass boundaries
through — a borrow of the host’s TimestampRing, or nothing at all.
Copy and one pointer wide, so it is threaded through the frame walk by
value: every pass site asks it for its own timestamp_writes and takes
None for an answer without a branch of its own. An inert sink
(FrameTimestamps::default) is what an ordinary
crate::EngineRenderer::encode passes, so the untimed frame path is the
timed one with every answer None.
Implementations§
Source§impl<'a> FrameTimestamps<'a>
impl<'a> FrameTimestamps<'a>
Sourcepub fn new(ring: &'a TimestampRing) -> Self
pub fn new(ring: &'a TimestampRing) -> Self
A sink writing into ring, or an inert one when the ring is itself
inert — a host holding a ring for a device without TIMESTAMP_QUERY
records exactly the passes it always did.
Sourcepub fn writes(&self, span: EngineSpan) -> Option<RenderPassTimestampWrites<'a>>
pub fn writes(&self, span: EngineSpan) -> Option<RenderPassTimestampWrites<'a>>
The timestamp_writes for one pass belonging to span, or None for
an untimed pass. Every call takes a fresh query pair, so a span made of
several passes sums rather than overwriting itself.