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: QuerySetHandleSet 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: u32Query written when the pass begins.
end_of_pass: u32Query 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.