[][src]Enum wgpu::TextureFormat

#[repr(C)]pub enum TextureFormat {
    R8Unorm,
    R8Snorm,
    R8Uint,
    R8Sint,
    R16Uint,
    R16Sint,
    R16Float,
    Rg8Unorm,
    Rg8Snorm,
    Rg8Uint,
    Rg8Sint,
    R32Uint,
    R32Sint,
    R32Float,
    Rg16Uint,
    Rg16Sint,
    Rg16Float,
    Rgba8Unorm,
    Rgba8UnormSrgb,
    Rgba8Snorm,
    Rgba8Uint,
    Rgba8Sint,
    Bgra8Unorm,
    Bgra8UnormSrgb,
    Rgb10a2Unorm,
    Rg11b10Float,
    Rg32Uint,
    Rg32Sint,
    Rg32Float,
    Rgba16Uint,
    Rgba16Sint,
    Rgba16Float,
    Rgba32Uint,
    Rgba32Sint,
    Rgba32Float,
    Depth32Float,
    Depth24Plus,
    Depth24PlusStencil8,
    Bc1RgbaUnorm,
    Bc1RgbaUnormSrgb,
    Bc2RgbaUnorm,
    Bc2RgbaUnormSrgb,
    Bc3RgbaUnorm,
    Bc3RgbaUnormSrgb,
    Bc4RUnorm,
    Bc4RSnorm,
    Bc5RgUnorm,
    Bc5RgSnorm,
    Bc6hRgbUfloat,
    Bc6hRgbSfloat,
    Bc7RgbaUnorm,
    Bc7RgbaUnormSrgb,
}

Underlying texture data format.

If there is a conversion in the format (such as srgb -> linear), The conversion listed is for loading from texture in a shader. When writing to the texture, the opposite conversion takes place.

Variants

R8Unorm

Red channel only. 8 bit integer per channel. [0, 255] converted to/from float [0, 1] in shader.

R8Snorm

Red channel only. 8 bit integer per channel. [-127, 127] converted to/from float [-1, 1] in shader.

R8Uint

Red channel only. 8 bit integer per channel. Unsigned in shader.

R8Sint

Red channel only. 8 bit integer per channel. Signed in shader.

R16Uint

Red channel only. 16 bit integer per channel. Unsigned in shader.

R16Sint

Red channel only. 16 bit integer per channel. Signed in shader.

R16Float

Red channel only. 16 bit float per channel. Float in shader.

Rg8Unorm

Red and green channels. 8 bit integer per channel. [0, 255] converted to/from float [0, 1] in shader.

Rg8Snorm

Red and green channels. 8 bit integer per channel. [-127, 127] converted to/from float [-1, 1] in shader.

Rg8Uint

Red and green channels. 8 bit integer per channel. Unsigned in shader.

Rg8Sint

Red and green channel s. 8 bit integer per channel. Signed in shader.

R32Uint

Red channel only. 32 bit integer per channel. Unsigned in shader.

R32Sint

Red channel only. 32 bit integer per channel. Signed in shader.

R32Float

Red channel only. 32 bit float per channel. Float in shader.

Rg16Uint

Red and green channels. 16 bit integer per channel. Unsigned in shader.

Rg16Sint

Red and green channels. 16 bit integer per channel. Signed in shader.

Rg16Float

Red and green channels. 16 bit float per channel. Float in shader.

Rgba8Unorm

Red, green, blue, and alpha channels. 8 bit integer per channel. [0, 255] converted to/from float [0, 1] in shader.

Rgba8UnormSrgb

Red, green, blue, and alpha channels. 8 bit integer per channel. Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.

Rgba8Snorm

Red, green, blue, and alpha channels. 8 bit integer per channel. [-127, 127] converted to/from float [-1, 1] in shader.

Rgba8Uint

Red, green, blue, and alpha channels. 8 bit integer per channel. Unsigned in shader.

Rgba8Sint

Red, green, blue, and alpha channels. 8 bit integer per channel. Signed in shader.

Bgra8Unorm

Blue, green, red, and alpha channels. 8 bit integer per channel. [0, 255] converted to/from float [0, 1] in shader.

Bgra8UnormSrgb

Blue, green, red, and alpha channels. 8 bit integer per channel. Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.

Rgb10a2Unorm

Red, green, blue, and alpha channels. 10 bit integer for RGB channels, 2 bit integer for alpha channel. [0, 1023] ([0, 3] for alpha) converted to/from float [0, 1] in shader.

Rg11b10Float

Red, green, and blue channels. 11 bit float with no sign bit for RG channels. 10 bit float with no sign bit for blue channel. Float in shader.

Rg32Uint

Red and green channels. 32 bit integer per channel. Unsigned in shader.

Rg32Sint

Red and green channels. 32 bit integer per channel. Signed in shader.

Rg32Float

Red and green channels. 32 bit float per channel. Float in shader.

Rgba16Uint

Red, green, blue, and alpha channels. 16 bit integer per channel. Unsigned in shader.

Rgba16Sint

Red, green, blue, and alpha channels. 16 bit integer per channel. Signed in shader.

Rgba16Float

Red, green, blue, and alpha channels. 16 bit float per channel. Float in shader.

Rgba32Uint

Red, green, blue, and alpha channels. 32 bit integer per channel. Unsigned in shader.

Rgba32Sint

Red, green, blue, and alpha channels. 32 bit integer per channel. Signed in shader.

Rgba32Float

Red, green, blue, and alpha channels. 32 bit float per channel. Float in shader.

Depth32Float

Special depth format with 32 bit floating point depth.

Depth24Plus

Special depth format with at least 24 bit integer depth.

Depth24PlusStencil8

Special depth/stencil format with at least 24 bit integer depth and 8 bits integer stencil.

Bc1RgbaUnorm

4x4 block compressed texture. 8 bytes per block (4 bit/px). 4 color + alpha pallet. 5 bit R + 6 bit G + 5 bit B + 1 bit alpha. [0, 64] ([0, 1] for alpha) converted to/from float [0, 1] in shader.

Also known as DXT1.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc1RgbaUnormSrgb

4x4 block compressed texture. 8 bytes per block (4 bit/px). 4 color + alpha pallet. 5 bit R + 6 bit G + 5 bit B + 1 bit alpha. Srgb-color [0, 64] ([0, 16] for alpha) converted to/from linear-color float [0, 1] in shader.

Also known as DXT1.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc2RgbaUnorm

4x4 block compressed texture. 16 bytes per block (8 bit/px). 4 color pallet. 5 bit R + 6 bit G + 5 bit B + 4 bit alpha. [0, 64] ([0, 16] for alpha) converted to/from float [0, 1] in shader.

Also known as DXT3.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc2RgbaUnormSrgb

4x4 block compressed texture. 16 bytes per block (8 bit/px). 4 color pallet. 5 bit R + 6 bit G + 5 bit B + 4 bit alpha. Srgb-color [0, 64] ([0, 256] for alpha) converted to/from linear-color float [0, 1] in shader.

Also known as DXT3.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc3RgbaUnorm

4x4 block compressed texture. 16 bytes per block (8 bit/px). 4 color pallet + 8 alpha pallet. 5 bit R + 6 bit G + 5 bit B + 8 bit alpha. [0, 64] ([0, 256] for alpha) converted to/from float [0, 1] in shader.

Also known as DXT5.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc3RgbaUnormSrgb

4x4 block compressed texture. 16 bytes per block (8 bit/px). 4 color pallet + 8 alpha pallet. 5 bit R + 6 bit G + 5 bit B + 8 bit alpha. Srgb-color [0, 64] ([0, 256] for alpha) converted to/from linear-color float [0, 1] in shader.

Also known as DXT5.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc4RUnorm

4x4 block compressed texture. 8 bytes per block (4 bit/px). 8 color pallet. 8 bit R. [0, 256] converted to/from float [0, 1] in shader.

Also known as RGTC1.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc4RSnorm

4x4 block compressed texture. 8 bytes per block (4 bit/px). 8 color pallet. 8 bit R. [-127, 127] converted to/from float [-1, 1] in shader.

Also known as RGTC1.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc5RgUnorm

4x4 block compressed texture. 16 bytes per block (16 bit/px). 8 color red pallet + 8 color green pallet. 8 bit RG. [0, 256] converted to/from float [0, 1] in shader.

Also known as RGTC2.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc5RgSnorm

4x4 block compressed texture. 16 bytes per block (16 bit/px). 8 color red pallet + 8 color green pallet. 8 bit RG. [-127, 127] converted to/from float [-1, 1] in shader.

Also known as RGTC2.

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc6hRgbUfloat

4x4 block compressed texture. 16 bytes per block (16 bit/px). Variable sized pallet. 16 bit unsigned float RGB. Float in shader.

Also known as BPTC (float).

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc6hRgbSfloat

4x4 block compressed texture. 16 bytes per block (16 bit/px). Variable sized pallet. 16 bit signed float RGB. Float in shader.

Also known as BPTC (float).

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc7RgbaUnorm

4x4 block compressed texture. 16 bytes per block (16 bit/px). Variable sized pallet. 8 bit integer RGBA. [0, 256] converted to/from float [0, 1] in shader.

Also known as BPTC (unorm).

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Bc7RgbaUnormSrgb

4x4 block compressed texture. 16 bytes per block (16 bit/px). Variable sized pallet. 8 bit integer RGBA. Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.

Also known as BPTC (unorm).

Features::TEXTURE_COMPRESSION_BC must be enabled to use this texture format.

Trait Implementations

impl Clone for TextureFormat[src]

impl Copy for TextureFormat[src]

impl Debug for TextureFormat[src]

impl<'de> Deserialize<'de> for TextureFormat[src]

impl Eq for TextureFormat[src]

impl From<TextureFormat> for ColorStateDescriptor[src]

impl From<TextureFormat> for TextureComponentType[src]

impl Hash for TextureFormat[src]

impl PartialEq<TextureFormat> for TextureFormat[src]

impl Serialize for TextureFormat[src]

impl StructuralEq for TextureFormat[src]

impl StructuralPartialEq for TextureFormat[src]

Auto Trait Implementations

impl RefUnwindSafe for TextureFormat

impl Send for TextureFormat

impl Sync for TextureFormat

impl Unpin for TextureFormat

impl UnwindSafe for TextureFormat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.