#[repr(transparent)]pub struct SDL_GPUTextureUsageFlags(pub Uint32);Expand description
Specifies how a texture is intended to be used by the client.
A texture must have at least one usage flag. Note that some usage flag combinations are invalid.
With regards to compute storage usage, READ | WRITE means that you can have shader A that only writes into the texture and shader B that only reads from the texture and bind the same texture to either shader respectively. SIMULTANEOUS means that you can do reads and writes within the same shader or compute pass. It also implies that atomic ops can be used, since those are read-modify-write operations. If you use SIMULTANEOUS, you are responsible for avoiding data races, as there is no data synchronization within a compute pass. Note that SIMULTANEOUS usage is only supported by a limited number of texture formats.
§Availability
This datatype is available since SDL 3.2.0.
§See also
§Known values (sdl3-sys)
| Associated constant | Global constant | Description |
|---|---|---|
SAMPLER | SDL_GPU_TEXTUREUSAGE_SAMPLER | Texture supports sampling. |
COLOR_TARGET | SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | Texture is a color render target. |
DEPTH_STENCIL_TARGET | SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET | Texture is a depth stencil target. |
GRAPHICS_STORAGE_READ | SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ | Texture supports storage reads in graphics stages. |
COMPUTE_STORAGE_READ | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ | Texture supports storage reads in the compute stage. |
COMPUTE_STORAGE_WRITE | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE | Texture supports storage writes in the compute stage. |
COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE | Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ |
Tuple Fields§
§0: Uint32Implementations§
Source§impl SDL_GPUTextureUsageFlags
impl SDL_GPUTextureUsageFlags
Sourcepub const COLOR_TARGET: Self
pub const COLOR_TARGET: Self
Texture is a color render target.
Sourcepub const DEPTH_STENCIL_TARGET: Self
pub const DEPTH_STENCIL_TARGET: Self
Texture is a depth stencil target.
Sourcepub const GRAPHICS_STORAGE_READ: Self
pub const GRAPHICS_STORAGE_READ: Self
Texture supports storage reads in graphics stages.
Sourcepub const COMPUTE_STORAGE_READ: Self
pub const COMPUTE_STORAGE_READ: Self
Texture supports storage reads in the compute stage.
Sourcepub const COMPUTE_STORAGE_WRITE: Self
pub const COMPUTE_STORAGE_WRITE: Self
Texture supports storage writes in the compute stage.
Sourcepub const COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE: Self
pub const COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE: Self
Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE.
Trait Implementations§
Source§impl BitAnd for SDL_GPUTextureUsageFlags
impl BitAnd for SDL_GPUTextureUsageFlags
Source§impl BitAndAssign for SDL_GPUTextureUsageFlags
impl BitAndAssign for SDL_GPUTextureUsageFlags
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for SDL_GPUTextureUsageFlags
impl BitOr for SDL_GPUTextureUsageFlags
Source§impl BitOrAssign for SDL_GPUTextureUsageFlags
impl BitOrAssign for SDL_GPUTextureUsageFlags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for SDL_GPUTextureUsageFlags
impl BitXor for SDL_GPUTextureUsageFlags
Source§impl BitXorAssign for SDL_GPUTextureUsageFlags
impl BitXorAssign for SDL_GPUTextureUsageFlags
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for SDL_GPUTextureUsageFlags
impl Clone for SDL_GPUTextureUsageFlags
Source§fn clone(&self) -> SDL_GPUTextureUsageFlags
fn clone(&self) -> SDL_GPUTextureUsageFlags
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_GPUTextureUsageFlags
Available on crate feature debug-impls only.
impl Debug for SDL_GPUTextureUsageFlags
debug-impls only.Source§impl Default for SDL_GPUTextureUsageFlags
impl Default for SDL_GPUTextureUsageFlags
Source§fn default() -> SDL_GPUTextureUsageFlags
fn default() -> SDL_GPUTextureUsageFlags
Source§impl From<SDL_GPUTextureUsageFlags> for Uint32
impl From<SDL_GPUTextureUsageFlags> for Uint32
Source§fn from(value: SDL_GPUTextureUsageFlags) -> Self
fn from(value: SDL_GPUTextureUsageFlags) -> Self
Source§impl GroupMetadata for SDL_GPUTextureUsageFlags
Available on crate feature metadata only.
impl GroupMetadata for SDL_GPUTextureUsageFlags
metadata only.