Skip to main content

QueryKind

Enum QueryKind 

Source
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

Source

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.

Trait Implementations§

Source§

impl Clone for QueryKind

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 QueryKind

Source§

impl Debug for QueryKind

Source§

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

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

impl Eq for QueryKind

Source§

impl Hash for QueryKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for QueryKind

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 QueryKind

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.