Skip to main content

PassTimestampWrites

Struct PassTimestampWrites 

Source
pub struct PassTimestampWrites {
    pub set: QuerySetHandle,
    pub beginning_of_pass: u32,
    pub end_of_pass: u32,
}
Expand description

The two timestamps that bracket a pass — the seam’s only timestamp verb.

A timestamp is named by the pass it brackets rather than by a point in the command stream, because a point in the command stream is not something every API can express. Vulkan’s vkCmdWriteTimestamp2 and D3D12’s EndQuery on a timestamp heap take one anywhere; Metal samples only where a device’s MTLCounterSamplingPoint values allow, which is stage boundaries; and WebGPU takes them only through GPURenderPassDescriptor.timestampWrites and GPUComputePassDescriptor.timestampWrites, whose beginningOfPassWriteIndex/endOfPassWriteIndex this struct is. Half the backends cannot honour an arbitrary point at all, so the pass boundary is the intersection — and putting it in the descriptor makes it a shape rather than a rule a caller has to remember, because there is no free-standing call left to record in the wrong place.

Consequently a pass is the smallest thing this seam can time. A copy or a barrier is not inside one, so what a profiler attributes to a pass is the pass alone, and the transitions the caller emitted around it are attributed to nothing.

Fields§

§set: QuerySetHandle

Set the two queries are written into. Must hold QueryKind::Timestamp queries; a backend fails the encoder rather than writing a timestamp into a pool of another kind.

§beginning_of_pass: u32

Query written when the pass begins.

§end_of_pass: u32

Query written when the pass ends.

Distinct from beginning_of_pass: WebGPU requires the two indices to differ, and a pass that wrote both ends into one query would report the second over the first on every other backend, so a backend refuses the pair rather than measuring nothing.

Trait Implementations§

Source§

impl Clone for PassTimestampWrites

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 PassTimestampWrites

Source§

impl Debug for PassTimestampWrites

Source§

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

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

impl Eq for PassTimestampWrites

Source§

impl PartialEq for PassTimestampWrites

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 PassTimestampWrites

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