Skip to main content

TextureFormat

Enum TextureFormat 

Source
#[repr(C)]
pub enum TextureFormat {
Show 38 variants R8Unorm = 0, R8Snorm = 1, R8Uint = 2, R8Sint = 3, R16Uint = 4, R16Sint = 5, R16Float = 6, Rg8Unorm = 7, Rg8Snorm = 8, Rg8Uint = 9, Rg8Sint = 10, R32Uint = 11, R32Sint = 12, R32Float = 13, Rg16Uint = 14, Rg16Sint = 15, Rg16Float = 16, Rgba8Unorm = 17, Rgba8UnormSrgb = 18, Rgba8Snorm = 19, Rgba8Uint = 20, Rgba8Sint = 21, Bgra8Unorm = 22, Bgra8UnormSrgb = 23, Rgb10a2Unorm = 24, Rg11b10Float = 25, Rg32Uint = 26, Rg32Sint = 27, Rg32Float = 28, Rgba16Uint = 29, Rgba16Sint = 30, Rgba16Float = 31, Rgba32Uint = 32, Rgba32Sint = 33, Rgba32Float = 34, Depth32Float = 35, Depth24Plus = 36, Depth24PlusStencil8 = 37,
}
Expand description

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 = 0

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

§

R8Snorm = 1

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

§

R8Uint = 2

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

§

R8Sint = 3

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

§

R16Uint = 4

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

§

R16Sint = 5

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

§

R16Float = 6

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

§

Rg8Unorm = 7

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

§

Rg8Snorm = 8

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

§

Rg8Uint = 9

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

§

Rg8Sint = 10

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

§

R32Uint = 11

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

§

R32Sint = 12

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

§

R32Float = 13

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

§

Rg16Uint = 14

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

§

Rg16Sint = 15

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

§

Rg16Float = 16

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

§

Rgba8Unorm = 17

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

§

Rgba8UnormSrgb = 18

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 = 19

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

§

Rgba8Uint = 20

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

§

Rgba8Sint = 21

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

§

Bgra8Unorm = 22

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

§

Bgra8UnormSrgb = 23

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 = 24

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 = 25

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

§

Rg32Uint = 26

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

§

Rg32Sint = 27

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

§

Rg32Float = 28

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

§

Rgba16Uint = 29

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

§

Rgba16Sint = 30

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

§

Rgba16Float = 31

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

§

Rgba32Uint = 32

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

§

Rgba32Sint = 33

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

§

Rgba32Float = 34

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

§

Depth32Float = 35

Special depth format with 32 bit floating point depth.

§

Depth24Plus = 36

Special depth format with at least 24 bit integer depth.

§

Depth24PlusStencil8 = 37

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

Trait Implementations§

Source§

impl Clone for TextureFormat

Source§

fn clone(&self) -> TextureFormat

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 TextureFormat

Source§

impl Debug for TextureFormat

Source§

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

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

impl<'de> Deserialize<'de> for TextureFormat

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TextureFormat, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TextureFormat

Source§

impl From<TextureFormat> for TextureComponentType

Source§

fn from(format: TextureFormat) -> TextureComponentType

Converts to this type from the input type.
Source§

impl Hash for TextureFormat

Source§

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

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 TextureFormat

Source§

fn eq(&self, other: &TextureFormat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TextureFormat

Source§

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
Source§

impl StructuralPartialEq for TextureFormat

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.