Skip to main content

Query

Trait Query 

Source
pub trait Query {
    type Dimensions: Dimensions;
    type Component: Component;

    // Required method
    fn base_dimensions(&self) -> Self::Dimensions;

    // Provided methods
    fn array_layers(&self) -> NonZeroU32 { ... }
    fn mip_levels(&self) -> NonZeroU32 { ... }
    fn samples(&self) -> NonZeroU32 { ... }
}
Expand description

Information about a texture.

This trait is implemented by all the texture types like Texture1d, Texture2d, etc.

Required Associated Types§

Source

type Dimensions: Dimensions

Type of the dimensions of the texture. Should be a Scalar, Vec2, or Vec3 of NonZeroU32.

Source

type Component: Component

Numeric type exposed to the shader.

Should be one of u32, i32, or f32, and must match the parameter of the texture type in the shader.

Required Methods§

Source

fn base_dimensions(&self) -> Self::Dimensions

Returns the dimensions of mip level 0 of the texture.

Provided Methods§

Source

fn array_layers(&self) -> NonZeroU32

Returns the count of array layers of the texture.

For non-array textures, returns 1.

Source

fn mip_levels(&self) -> NonZeroU32

Returns the count of mip levels of the texture.

Source

fn samples(&self) -> NonZeroU32

Returns the count of samples of the texture.

For non-multisampled textures, returns 1.

Implementors§