Struct SDL_GPUTextureFormat
#[repr(transparent)]pub struct SDL_GPUTextureFormat(pub i32);
dep_sdl3
only.Expand description
Specifies the pixel format of a texture.
Texture format support varies depending on driver, hardware, and usage
flags. In general, you should use SDL_GPUTextureSupportsFormat
to query if
a format is supported before using it. However, there are a few guaranteed
formats.
FIXME: Check universal support for 32-bit component formats FIXME: Check universal support for SIMULTANEOUS_READ_WRITE
For SAMPLER usage, the following formats are universally supported:
- R8G8B8A8_UNORM
- B8G8R8A8_UNORM
- R8_UNORM
- R8_SNORM
- R8G8_UNORM
- R8G8_SNORM
- R8G8B8A8_SNORM
- R16_FLOAT
- R16G16_FLOAT
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R11G11B10_UFLOAT
- R8G8B8A8_UNORM_SRGB
- B8G8R8A8_UNORM_SRGB
- D16_UNORM
For COLOR_TARGET usage, the following formats are universally supported:
- R8G8B8A8_UNORM
- B8G8R8A8_UNORM
- R8_UNORM
- R16_FLOAT
- R16G16_FLOAT
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R8_UINT
- R8G8_UINT
- R8G8B8A8_UINT
- R16_UINT
- R16G16_UINT
- R16G16B16A16_UINT
- R8_INT
- R8G8_INT
- R8G8B8A8_INT
- R16_INT
- R16G16_INT
- R16G16B16A16_INT
- R8G8B8A8_UNORM_SRGB
- B8G8R8A8_UNORM_SRGB
For STORAGE usages, the following formats are universally supported:
- R8G8B8A8_UNORM
- R8G8B8A8_SNORM
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R8G8B8A8_UINT
- R16G16B16A16_UINT
- R8G8B8A8_INT
- R16G16B16A16_INT
For DEPTH_STENCIL_TARGET usage, the following formats are universally supported:
- D16_UNORM
- Either (but not necessarily both!) D24_UNORM or D32_FLOAT
- Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_FLOAT_S8_UINT
Unless D16_UNORM is sufficient for your purposes, always check which of D24/D32 is supported before creating a depth-stencil texture!
§Availability
This enum is available since SDL 3.2.0.
§See also
§Known values (sdl3-sys
)
Tuple Fields§
§0: i32
Implementations§
§impl SDL_GPUTextureFormat
impl SDL_GPUTextureFormat
pub const INVALID: SDL_GPUTextureFormat
pub const A8_UNORM: SDL_GPUTextureFormat
pub const R8_UNORM: SDL_GPUTextureFormat
pub const R8G8_UNORM: SDL_GPUTextureFormat
pub const R8G8B8A8_UNORM: SDL_GPUTextureFormat
pub const R16_UNORM: SDL_GPUTextureFormat
pub const R16G16_UNORM: SDL_GPUTextureFormat
pub const R16G16B16A16_UNORM: SDL_GPUTextureFormat
pub const R10G10B10A2_UNORM: SDL_GPUTextureFormat
pub const B5G6R5_UNORM: SDL_GPUTextureFormat
pub const B5G5R5A1_UNORM: SDL_GPUTextureFormat
pub const B4G4R4A4_UNORM: SDL_GPUTextureFormat
pub const B8G8R8A8_UNORM: SDL_GPUTextureFormat
pub const BC1_RGBA_UNORM: SDL_GPUTextureFormat
pub const BC2_RGBA_UNORM: SDL_GPUTextureFormat
pub const BC3_RGBA_UNORM: SDL_GPUTextureFormat
pub const BC4_R_UNORM: SDL_GPUTextureFormat
pub const BC5_RG_UNORM: SDL_GPUTextureFormat
pub const BC7_RGBA_UNORM: SDL_GPUTextureFormat
pub const BC6H_RGB_FLOAT: SDL_GPUTextureFormat
pub const BC6H_RGB_UFLOAT: SDL_GPUTextureFormat
pub const R8_SNORM: SDL_GPUTextureFormat
pub const R8G8_SNORM: SDL_GPUTextureFormat
pub const R8G8B8A8_SNORM: SDL_GPUTextureFormat
pub const R16_SNORM: SDL_GPUTextureFormat
pub const R16G16_SNORM: SDL_GPUTextureFormat
pub const R16G16B16A16_SNORM: SDL_GPUTextureFormat
pub const R16_FLOAT: SDL_GPUTextureFormat
pub const R16G16_FLOAT: SDL_GPUTextureFormat
pub const R16G16B16A16_FLOAT: SDL_GPUTextureFormat
pub const R32_FLOAT: SDL_GPUTextureFormat
pub const R32G32_FLOAT: SDL_GPUTextureFormat
pub const R32G32B32A32_FLOAT: SDL_GPUTextureFormat
pub const R11G11B10_UFLOAT: SDL_GPUTextureFormat
pub const R8_UINT: SDL_GPUTextureFormat
pub const R8G8_UINT: SDL_GPUTextureFormat
pub const R8G8B8A8_UINT: SDL_GPUTextureFormat
pub const R16_UINT: SDL_GPUTextureFormat
pub const R16G16_UINT: SDL_GPUTextureFormat
pub const R16G16B16A16_UINT: SDL_GPUTextureFormat
pub const R32_UINT: SDL_GPUTextureFormat
pub const R32G32_UINT: SDL_GPUTextureFormat
pub const R32G32B32A32_UINT: SDL_GPUTextureFormat
pub const R8_INT: SDL_GPUTextureFormat
pub const R8G8_INT: SDL_GPUTextureFormat
pub const R8G8B8A8_INT: SDL_GPUTextureFormat
pub const R16_INT: SDL_GPUTextureFormat
pub const R16G16_INT: SDL_GPUTextureFormat
pub const R16G16B16A16_INT: SDL_GPUTextureFormat
pub const R32_INT: SDL_GPUTextureFormat
pub const R32G32_INT: SDL_GPUTextureFormat
pub const R32G32B32A32_INT: SDL_GPUTextureFormat
pub const R8G8B8A8_UNORM_SRGB: SDL_GPUTextureFormat
pub const B8G8R8A8_UNORM_SRGB: SDL_GPUTextureFormat
pub const BC1_RGBA_UNORM_SRGB: SDL_GPUTextureFormat
pub const BC2_RGBA_UNORM_SRGB: SDL_GPUTextureFormat
pub const BC3_RGBA_UNORM_SRGB: SDL_GPUTextureFormat
pub const BC7_RGBA_UNORM_SRGB: SDL_GPUTextureFormat
pub const D16_UNORM: SDL_GPUTextureFormat
pub const D24_UNORM: SDL_GPUTextureFormat
pub const D32_FLOAT: SDL_GPUTextureFormat
pub const D24_UNORM_S8_UINT: SDL_GPUTextureFormat
pub const D32_FLOAT_S8_UINT: SDL_GPUTextureFormat
pub const ASTC_4x4_UNORM: SDL_GPUTextureFormat
pub const ASTC_5x4_UNORM: SDL_GPUTextureFormat
pub const ASTC_5x5_UNORM: SDL_GPUTextureFormat
pub const ASTC_6x5_UNORM: SDL_GPUTextureFormat
pub const ASTC_6x6_UNORM: SDL_GPUTextureFormat
pub const ASTC_8x5_UNORM: SDL_GPUTextureFormat
pub const ASTC_8x6_UNORM: SDL_GPUTextureFormat
pub const ASTC_8x8_UNORM: SDL_GPUTextureFormat
pub const ASTC_10x5_UNORM: SDL_GPUTextureFormat
pub const ASTC_10x6_UNORM: SDL_GPUTextureFormat
pub const ASTC_10x8_UNORM: SDL_GPUTextureFormat
pub const ASTC_10x10_UNORM: SDL_GPUTextureFormat
pub const ASTC_12x10_UNORM: SDL_GPUTextureFormat
pub const ASTC_12x12_UNORM: SDL_GPUTextureFormat
pub const ASTC_4x4_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_5x4_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_5x5_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_6x5_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_6x6_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_8x5_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_8x6_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_8x8_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_10x5_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_10x6_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_10x8_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_10x10_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_12x10_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_12x12_UNORM_SRGB: SDL_GPUTextureFormat
pub const ASTC_4x4_FLOAT: SDL_GPUTextureFormat
pub const ASTC_5x4_FLOAT: SDL_GPUTextureFormat
pub const ASTC_5x5_FLOAT: SDL_GPUTextureFormat
pub const ASTC_6x5_FLOAT: SDL_GPUTextureFormat
pub const ASTC_6x6_FLOAT: SDL_GPUTextureFormat
pub const ASTC_8x5_FLOAT: SDL_GPUTextureFormat
pub const ASTC_8x6_FLOAT: SDL_GPUTextureFormat
pub const ASTC_8x8_FLOAT: SDL_GPUTextureFormat
pub const ASTC_10x5_FLOAT: SDL_GPUTextureFormat
pub const ASTC_10x6_FLOAT: SDL_GPUTextureFormat
pub const ASTC_10x8_FLOAT: SDL_GPUTextureFormat
pub const ASTC_10x10_FLOAT: SDL_GPUTextureFormat
pub const ASTC_12x10_FLOAT: SDL_GPUTextureFormat
pub const ASTC_12x12_FLOAT: SDL_GPUTextureFormat
Trait Implementations§
§impl Clone for SDL_GPUTextureFormat
impl Clone for SDL_GPUTextureFormat
§fn clone(&self) -> SDL_GPUTextureFormat
fn clone(&self) -> SDL_GPUTextureFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Default for SDL_GPUTextureFormat
impl Default for SDL_GPUTextureFormat
§fn default() -> SDL_GPUTextureFormat
fn default() -> SDL_GPUTextureFormat
§impl From<SDL_GPUTextureFormat> for i32
impl From<SDL_GPUTextureFormat> for i32
§fn from(value: SDL_GPUTextureFormat) -> i32
fn from(value: SDL_GPUTextureFormat) -> i32
§impl Hash for SDL_GPUTextureFormat
impl Hash for SDL_GPUTextureFormat
§impl Ord for SDL_GPUTextureFormat
impl Ord for SDL_GPUTextureFormat
§fn cmp(&self, other: &SDL_GPUTextureFormat) -> Ordering
fn cmp(&self, other: &SDL_GPUTextureFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for SDL_GPUTextureFormat
impl PartialEq for SDL_GPUTextureFormat
§impl PartialOrd for SDL_GPUTextureFormat
impl PartialOrd for SDL_GPUTextureFormat
impl Copy for SDL_GPUTextureFormat
impl Eq for SDL_GPUTextureFormat
impl StructuralPartialEq for SDL_GPUTextureFormat
Auto Trait Implementations§
impl Freeze for SDL_GPUTextureFormat
impl RefUnwindSafe for SDL_GPUTextureFormat
impl Send for SDL_GPUTextureFormat
impl Sync for SDL_GPUTextureFormat
impl Unpin for SDL_GPUTextureFormat
impl UnwindSafe for SDL_GPUTextureFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more