pub enum QueryType {
Occlusion,
Timestamp,
PipelineStatistics(PipelineStatisticsTypes),
}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.