pub enum QueryKind {
Timestamp,
Occlusion,
PipelineStatistics,
}Expand description
What a query set measures.
Variants§
Timestamp
A GPU clock reading, taken at a pass boundary named by
PassTimestampWrites.
Device::query_results reports it in
nanoseconds — the backend converts from whatever its API counts in,
because the conversion is the one part of a timestamp that has no
cross-API spelling. resolve_query_set
writes the device’s own values instead, unconverted; it is a GPU-side
copy with nothing to multiply by.
Occlusion
Samples that passed the depth test between begin and end.
No backend will make you one, and
check_supported is where each of them says so:
there is no begin and no end to count between, because
CommandEncoder has no verb that opens a query
around a draw. The variant stays so that the day one arrives it is a
backend arm rather than a seam change; until then the kind is refused
rather than served, for the reason
NO_OCCLUSION_QUERY_VERB gives.
The engine’s own occlusion culling never wanted this: it is a two-phase depth pyramid in compute (topic 03 §3.3), so nothing here is waiting on the verb.
PipelineStatistics
Primitive and invocation counts.
Implementations§
Source§impl QueryKind
impl QueryKind
Sourcepub fn check_supported(self, backend: BackendKind) -> Result<(), HalError>
pub fn check_supported(self, backend: BackendKind) -> Result<(), HalError>
Refuses Occlusion, the kind no backend serves.
Every backend’s
create_query_set runs this before it
builds anything, so the one refusal every one of them makes is written
once and reads the same wherever a caller meets it — the shape
ShaderStages::check_supported
and ImageViewDesc::check already use for
a rule the whole seam keeps.
It is the seam that refuses, not the device, which is why there is no
Features argument: Vulkan, D3D12, Metal and WebGPU
can all count samples, and
Features::OCCLUSION_QUERY goes on
reporting that. What is absent is the verb that would scope a count, and
no device supplies one. NO_OCCLUSION_QUERY_VERB
carries the whole argument, and is the same sentence
Device::supports declares and
DIVERGENCES records.
§Errors
HalError::Unsupported for
Occlusion, attributed to backend so a caller reads
the refusal in the voice of the backend it asked.