Enum QueryType
pub enum QueryType {
Occlusion,
Timestamp,
PipelineStatistics(PipelineStatisticsTypes),
}unstable-wgpu-29 only.Expand description
Type of queries contained in a QuerySet.
Each query set may contain any number of queries, but they must all be of the same type.
Corresponds to WebGPU GPUQueryType.
Variants§
Occlusion
An occlusion query reports whether any of the fragments drawn within the scope of the query passed all per-fragment tests (i.e. were not occluded).
Occlusion queries are performed by setting RenderPassDescriptor::occlusion_query_set,
then calling RenderPass::begin_occlusion_query() and
RenderPass::end_occlusion_query().
The query writes to a single result slot in the query set, whose value will be either 0 or 1
as a boolean.
Timestamp
A timestamp query records a GPU-timestamp value at which a certain command started or finished executing.
Timestamp queries are performed by any one of:
- Setting
ComputePassDescriptor::timestamp_writes - Setting
RenderPassDescriptor::timestamp_writes - Calling
CommandEncoder::write_timestamp() - Calling
RenderPass::write_timestamp() - Calling
ComputePass::write_timestamp()
Each timestamp query writes to a single result slot in the query set.
The timestamp value must be multiplied by Queue::get_timestamp_period() to get
the time in nanoseconds.
Absolute values have no meaning, but timestamps can be subtracted to get the time it takes
for a string of operations to complete.
Timestamps may overflow and wrap to 0, resulting in occasional spurious negative deltas.
Additionally, passes may be executed in parallel or out of the order they were submitted; this does not affect their results but is observable via these timestamps.
Features::TIMESTAMP_QUERY must be enabled to use this query type.
PipelineStatistics(PipelineStatisticsTypes)
A pipeline statistics query records information about the execution of pipelines;
see PipelineStatisticsTypes’s documentation for details.
Pipeline statistics queries are performed by:
A single query may occupy up to 5 result slots in the query set, based on the flags given here.
Features::PIPELINE_STATISTICS_QUERY must be enabled to use this query type.
Trait Implementations§
§impl From<QueryType> for SimplifiedQueryType
impl From<QueryType> for SimplifiedQueryType
§fn from(q: QueryType) -> SimplifiedQueryType
fn from(q: QueryType) -> SimplifiedQueryType
impl Copy for QueryType
Auto Trait Implementations§
impl Freeze for QueryType
impl RefUnwindSafe for QueryType
impl Send for QueryType
impl Sync for QueryType
impl Unpin for QueryType
impl UnsafeUnpin for QueryType
impl UnwindSafe for QueryType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.