Struct vulkano::buffer::BufferUsage
source · pub struct BufferUsage(/* private fields */);
Expand description
Describes how a buffer is going to be used. This is not just an optimization.
If you try to use a buffer in a way that you didn’t declare, an error will be returned.
Implementations§
source§impl BufferUsage
impl BufferUsage
sourcepub const TRANSFER_SRC: Self = _
pub const TRANSFER_SRC: Self = _
The buffer can be used as a source for transfer, blit, resolve and clear commands.
sourcepub const TRANSFER_DST: Self = _
pub const TRANSFER_DST: Self = _
The buffer can be used as a destination for transfer, blit, resolve and clear commands.
sourcepub const UNIFORM_TEXEL_BUFFER: Self = _
pub const UNIFORM_TEXEL_BUFFER: Self = _
The buffer can be used as a uniform texel buffer in a descriptor set.
sourcepub const STORAGE_TEXEL_BUFFER: Self = _
pub const STORAGE_TEXEL_BUFFER: Self = _
The buffer can be used as a storage texel buffer in a descriptor set.
sourcepub const UNIFORM_BUFFER: Self = _
pub const UNIFORM_BUFFER: Self = _
The buffer can be used as a uniform buffer in a descriptor set.
sourcepub const STORAGE_BUFFER: Self = _
pub const STORAGE_BUFFER: Self = _
The buffer can be used as a storage buffer in a descriptor set.
sourcepub const INDEX_BUFFER: Self = _
pub const INDEX_BUFFER: Self = _
The buffer can be used as an index buffer.
sourcepub const VERTEX_BUFFER: Self = _
pub const VERTEX_BUFFER: Self = _
The buffer can be used as a vertex or instance buffer.
sourcepub const INDIRECT_BUFFER: Self = _
pub const INDIRECT_BUFFER: Self = _
The buffer can be used as an indirect buffer.
sourcepub const SHADER_DEVICE_ADDRESS: Self = _
pub const SHADER_DEVICE_ADDRESS: Self = _
The buffer’s device address can be retrieved.
A buffer created with this usage can only be bound to device memory allocated with the
MemoryAllocateFlags::DEVICE_ADDRESS
flag, unless the ext_buffer_device_address
extension is enabled on the device.
sourcepub const ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY: Self = _
pub const ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY: Self = _
The buffer can be used as input data for an acceleration structure build operation.
sourcepub const ACCELERATION_STRUCTURE_STORAGE: Self = _
pub const ACCELERATION_STRUCTURE_STORAGE: Self = _
An acceleration structure can be created from the buffer.
sourcepub const fn none() -> Self
👎Deprecated since 0.31.0: use empty
instead
pub const fn none() -> Self
empty
insteadReturns a BufferUsage
with none of the flags set.
sourcepub const fn intersects(self, other: Self) -> bool
pub const fn intersects(self, other: Self) -> bool
Returns whether any flags are set in both self
and other
.
sourcepub const fn contains(self, other: Self) -> bool
pub const fn contains(self, other: Self) -> bool
Returns whether all flags in other
are set in self
.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of self
and other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns self
without the flags set in other
.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the flags that are set in self
or other
, but not in both.
Trait Implementations§
source§impl BitAnd for BufferUsage
impl BitAnd for BufferUsage
source§impl BitAndAssign for BufferUsage
impl BitAndAssign for BufferUsage
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&=
operation. Read moresource§impl BitOr for BufferUsage
impl BitOr for BufferUsage
source§impl BitOrAssign for BufferUsage
impl BitOrAssign for BufferUsage
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|=
operation. Read moresource§impl BitXor for BufferUsage
impl BitXor for BufferUsage
source§impl BitXorAssign for BufferUsage
impl BitXorAssign for BufferUsage
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^=
operation. Read moresource§impl Clone for BufferUsage
impl Clone for BufferUsage
source§fn clone(&self) -> BufferUsage
fn clone(&self) -> BufferUsage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BufferUsage
impl Debug for BufferUsage
source§impl Default for BufferUsage
impl Default for BufferUsage
source§impl From<BufferUsage> for BufferUsageFlags
impl From<BufferUsage> for BufferUsageFlags
source§fn from(val: BufferUsage) -> Self
fn from(val: BufferUsage) -> Self
source§impl From<BufferUsageFlags> for BufferUsage
impl From<BufferUsageFlags> for BufferUsage
source§fn from(val: BufferUsageFlags) -> Self
fn from(val: BufferUsageFlags) -> Self
source§impl Hash for BufferUsage
impl Hash for BufferUsage
source§impl PartialEq for BufferUsage
impl PartialEq for BufferUsage
source§fn eq(&self, other: &BufferUsage) -> bool
fn eq(&self, other: &BufferUsage) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Sub for BufferUsage
impl Sub for BufferUsage
source§impl SubAssign for BufferUsage
impl SubAssign for BufferUsage
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more