#[repr(transparent)]pub struct SDL_GPUTextureFormat(pub c_int);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: c_intImplementations§
Source§impl SDL_GPUTextureFormat
impl SDL_GPUTextureFormat
pub const INVALID: Self
pub const A8_UNORM: Self
pub const R8_UNORM: Self
pub const R8G8_UNORM: Self
pub const R8G8B8A8_UNORM: Self
pub const R16_UNORM: Self
pub const R16G16_UNORM: Self
pub const R16G16B16A16_UNORM: Self
pub const R10G10B10A2_UNORM: Self
pub const B5G6R5_UNORM: Self
pub const B5G5R5A1_UNORM: Self
pub const B4G4R4A4_UNORM: Self
pub const B8G8R8A8_UNORM: Self
pub const BC1_RGBA_UNORM: Self
pub const BC2_RGBA_UNORM: Self
pub const BC3_RGBA_UNORM: Self
pub const BC4_R_UNORM: Self
pub const BC5_RG_UNORM: Self
pub const BC7_RGBA_UNORM: Self
pub const BC6H_RGB_FLOAT: Self
pub const BC6H_RGB_UFLOAT: Self
pub const R8_SNORM: Self
pub const R8G8_SNORM: Self
pub const R8G8B8A8_SNORM: Self
pub const R16_SNORM: Self
pub const R16G16_SNORM: Self
pub const R16G16B16A16_SNORM: Self
pub const R16_FLOAT: Self
pub const R16G16_FLOAT: Self
pub const R16G16B16A16_FLOAT: Self
pub const R32_FLOAT: Self
pub const R32G32_FLOAT: Self
pub const R32G32B32A32_FLOAT: Self
pub const R11G11B10_UFLOAT: Self
pub const R8_UINT: Self
pub const R8G8_UINT: Self
pub const R8G8B8A8_UINT: Self
pub const R16_UINT: Self
pub const R16G16_UINT: Self
pub const R16G16B16A16_UINT: Self
pub const R32_UINT: Self
pub const R32G32_UINT: Self
pub const R32G32B32A32_UINT: Self
pub const R8_INT: Self
pub const R8G8_INT: Self
pub const R8G8B8A8_INT: Self
pub const R16_INT: Self
pub const R16G16_INT: Self
pub const R16G16B16A16_INT: Self
pub const R32_INT: Self
pub const R32G32_INT: Self
pub const R32G32B32A32_INT: Self
pub const R8G8B8A8_UNORM_SRGB: Self
pub const B8G8R8A8_UNORM_SRGB: Self
pub const BC1_RGBA_UNORM_SRGB: Self
pub const BC2_RGBA_UNORM_SRGB: Self
pub const BC3_RGBA_UNORM_SRGB: Self
pub const BC7_RGBA_UNORM_SRGB: Self
pub const D16_UNORM: Self
pub const D24_UNORM: Self
pub const D32_FLOAT: Self
pub const D24_UNORM_S8_UINT: Self
pub const D32_FLOAT_S8_UINT: Self
pub const ASTC_4x4_UNORM: Self
pub const ASTC_5x4_UNORM: Self
pub const ASTC_5x5_UNORM: Self
pub const ASTC_6x5_UNORM: Self
pub const ASTC_6x6_UNORM: Self
pub const ASTC_8x5_UNORM: Self
pub const ASTC_8x6_UNORM: Self
pub const ASTC_8x8_UNORM: Self
pub const ASTC_10x5_UNORM: Self
pub const ASTC_10x6_UNORM: Self
pub const ASTC_10x8_UNORM: Self
pub const ASTC_10x10_UNORM: Self
pub const ASTC_12x10_UNORM: Self
pub const ASTC_12x12_UNORM: Self
pub const ASTC_4x4_UNORM_SRGB: Self
pub const ASTC_5x4_UNORM_SRGB: Self
pub const ASTC_5x5_UNORM_SRGB: Self
pub const ASTC_6x5_UNORM_SRGB: Self
pub const ASTC_6x6_UNORM_SRGB: Self
pub const ASTC_8x5_UNORM_SRGB: Self
pub const ASTC_8x6_UNORM_SRGB: Self
pub const ASTC_8x8_UNORM_SRGB: Self
pub const ASTC_10x5_UNORM_SRGB: Self
pub const ASTC_10x6_UNORM_SRGB: Self
pub const ASTC_10x8_UNORM_SRGB: Self
pub const ASTC_10x10_UNORM_SRGB: Self
pub const ASTC_12x10_UNORM_SRGB: Self
pub const ASTC_12x12_UNORM_SRGB: Self
pub const ASTC_4x4_FLOAT: Self
pub const ASTC_5x4_FLOAT: Self
pub const ASTC_5x5_FLOAT: Self
pub const ASTC_6x5_FLOAT: Self
pub const ASTC_6x6_FLOAT: Self
pub const ASTC_8x5_FLOAT: Self
pub const ASTC_8x6_FLOAT: Self
pub const ASTC_8x8_FLOAT: Self
pub const ASTC_10x5_FLOAT: Self
pub const ASTC_10x6_FLOAT: Self
pub const ASTC_10x8_FLOAT: Self
pub const ASTC_10x10_FLOAT: Self
pub const ASTC_12x10_FLOAT: Self
pub const ASTC_12x12_FLOAT: Self
Trait Implementations§
Source§impl Clone for SDL_GPUTextureFormat
impl Clone for SDL_GPUTextureFormat
Source§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 moreSource§impl Debug for SDL_GPUTextureFormat
Available on crate feature debug-impls only.
impl Debug for SDL_GPUTextureFormat
debug-impls only.Source§impl Default for SDL_GPUTextureFormat
impl Default for SDL_GPUTextureFormat
Source§fn default() -> SDL_GPUTextureFormat
fn default() -> SDL_GPUTextureFormat
Source§impl From<SDL_GPUTextureFormat> for c_int
impl From<SDL_GPUTextureFormat> for c_int
Source§fn from(value: SDL_GPUTextureFormat) -> Self
fn from(value: SDL_GPUTextureFormat) -> Self
Source§impl GroupMetadata for SDL_GPUTextureFormat
Available on crate feature metadata only.
impl GroupMetadata for SDL_GPUTextureFormat
metadata only.