#[repr(transparent)]pub struct SDL_GPUBufferUsageFlags(pub Uint32);Expand description
Specifies how a buffer is intended to be used by the client.
A buffer must have at least one usage flag.
If a buffer has multiple read usages, this may lead to a performance penalty due to more conservative memory barriers, but it also may not necessarily affect the performance.
Unlike textures, READ | WRITE can be used for simultaneous read-write usage. The same data synchronization concerns as textures apply.
If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
§Availability
This datatype is available since SDL 3.2.0.
§See also
§Known values (sdl3-sys)
| Associated constant | Global constant | Description |
|---|---|---|
VERTEX | SDL_GPU_BUFFERUSAGE_VERTEX | Buffer is a vertex buffer. |
INDEX | SDL_GPU_BUFFERUSAGE_INDEX | Buffer is an index buffer. |
INDIRECT | SDL_GPU_BUFFERUSAGE_INDIRECT | Buffer is an indirect buffer. |
GRAPHICS_STORAGE_READ | SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ | Buffer supports storage reads in graphics stages. |
COMPUTE_STORAGE_READ | SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ | Buffer supports storage reads in the compute stage. |
COMPUTE_STORAGE_WRITE | SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE | Buffer supports storage writes in the compute stage. |
Tuple Fields§
§0: Uint32Implementations§
Source§impl SDL_GPUBufferUsageFlags
impl SDL_GPUBufferUsageFlags
Sourcepub const GRAPHICS_STORAGE_READ: Self
pub const GRAPHICS_STORAGE_READ: Self
Buffer supports storage reads in graphics stages.
Sourcepub const COMPUTE_STORAGE_READ: Self
pub const COMPUTE_STORAGE_READ: Self
Buffer supports storage reads in the compute stage.
Sourcepub const COMPUTE_STORAGE_WRITE: Self
pub const COMPUTE_STORAGE_WRITE: Self
Buffer supports storage writes in the compute stage.
Trait Implementations§
Source§impl BitAnd for SDL_GPUBufferUsageFlags
impl BitAnd for SDL_GPUBufferUsageFlags
Source§impl BitAndAssign for SDL_GPUBufferUsageFlags
impl BitAndAssign for SDL_GPUBufferUsageFlags
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for SDL_GPUBufferUsageFlags
impl BitOr for SDL_GPUBufferUsageFlags
Source§impl BitOrAssign for SDL_GPUBufferUsageFlags
impl BitOrAssign for SDL_GPUBufferUsageFlags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for SDL_GPUBufferUsageFlags
impl BitXor for SDL_GPUBufferUsageFlags
Source§impl BitXorAssign for SDL_GPUBufferUsageFlags
impl BitXorAssign for SDL_GPUBufferUsageFlags
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for SDL_GPUBufferUsageFlags
impl Clone for SDL_GPUBufferUsageFlags
Source§fn clone(&self) -> SDL_GPUBufferUsageFlags
fn clone(&self) -> SDL_GPUBufferUsageFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SDL_GPUBufferUsageFlags
Source§impl Debug for SDL_GPUBufferUsageFlags
Available on crate feature debug-impls only.
impl Debug for SDL_GPUBufferUsageFlags
debug-impls only.Source§impl Default for SDL_GPUBufferUsageFlags
impl Default for SDL_GPUBufferUsageFlags
Source§fn default() -> SDL_GPUBufferUsageFlags
fn default() -> SDL_GPUBufferUsageFlags
impl Eq for SDL_GPUBufferUsageFlags
Source§impl From<SDL_GPUBufferUsageFlags> for Uint32
impl From<SDL_GPUBufferUsageFlags> for Uint32
Source§fn from(value: SDL_GPUBufferUsageFlags) -> Self
fn from(value: SDL_GPUBufferUsageFlags) -> Self
Source§impl GroupMetadata for SDL_GPUBufferUsageFlags
Available on crate feature metadata only.
impl GroupMetadata for SDL_GPUBufferUsageFlags
metadata only.