pub type TextureDescriptor<'a> = TextureDescriptor<Option<&'a str>, &'a [TextureFormat]>;
Expand description

Describes a [Texture].

For use with [Device::create_texture].

Corresponds to WebGPU GPUTextureDescriptor.

Aliased Type§

struct TextureDescriptor<'a> {
    pub label: Option<&'a str>,
    pub size: Extent3d,
    pub mip_level_count: u32,
    pub sample_count: u32,
    pub dimension: TextureDimension,
    pub format: TextureFormat,
    pub usage: TextureUsages,
    pub view_formats: &'a [TextureFormat],


§label: Option<&'a str>

Debug label of the texture. This will show up in graphics debuggers for easy identification.

§size: Extent3d

Size of the texture. All components must be greater than zero. For a regular 1D/2D texture, the unused sizes will be 1. For 2DArray textures, Z is the number of 2D textures in that array.

§mip_level_count: u32

Mip count of texture. For a texture with no extra mips, this must be 1.

§sample_count: u32

Sample count of texture. If this is not 1, texture must have [BindingType::Texture::multisampled] set to true.

§dimension: TextureDimension

Dimensions of the texture.

§format: TextureFormat

Format of the texture.

§usage: TextureUsages

Allowed usages of the texture. If used in other ways, the operation will panic.

§view_formats: &'a [TextureFormat]

Specifies what view formats will be allowed when calling create_view() on this texture.

View formats of the same format as the texture are always allowed.

Note: currently, only the srgb-ness is allowed to change. (ex: Rgba8Unorm texture + Rgba8UnormSrgb view)

Trait Implementations§


impl<L, V> Clone for TextureDescriptor<L, V>where L: Clone, V: Clone,


fn clone(&self) -> TextureDescriptor<L, V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl<L, V> Debug for TextureDescriptor<L, V>where L: Debug, V: Debug,


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

Formats the value using the given formatter. Read more

impl<L, V> Serialize for TextureDescriptor<L, V>where L: Serialize, V: Serialize,


fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more