pub struct BufferUsage { /* private fields */ }
Expand description
A set of flags describing the allowed usages of a BufferId
.
These flags are crucial for performance and validation. The graphics driver uses them to place the buffer in the most optimal memory type (e.g., GPU-only vs. CPU-visible) and to validate that the buffer is used correctly at runtime.
Implementations§
Source§impl BufferUsage
impl BufferUsage
Sourcepub const EMPTY: BufferUsage
pub const EMPTY: BufferUsage
An empty set of flags.
Sourcepub const MAP_READ: BufferUsage
pub const MAP_READ: BufferUsage
The buffer can be mapped for reading on the CPU.
Sourcepub const MAP_WRITE: BufferUsage
pub const MAP_WRITE: BufferUsage
The buffer can be mapped for writing on the CPU.
Sourcepub const COPY_SRC: BufferUsage
pub const COPY_SRC: BufferUsage
The buffer can be used as the source of a copy operation.
Sourcepub const COPY_DST: BufferUsage
pub const COPY_DST: BufferUsage
The buffer can be used as the destination of a copy operation.
Sourcepub const VERTEX: BufferUsage
pub const VERTEX: BufferUsage
The buffer can be bound as a vertex buffer.
Sourcepub const INDEX: BufferUsage
pub const INDEX: BufferUsage
The buffer can be bound as an index buffer.
Sourcepub const UNIFORM: BufferUsage
pub const UNIFORM: BufferUsage
The buffer can be bound as a uniform buffer.
Sourcepub const STORAGE: BufferUsage
pub const STORAGE: BufferUsage
The buffer can be bound as a storage buffer (read/write access from shaders).
Sourcepub const INDIRECT: BufferUsage
pub const INDIRECT: BufferUsage
The buffer can be used for indirect draw or dispatch commands.
Sourcepub const QUERY_RESOLVE: BufferUsage
pub const QUERY_RESOLVE: BufferUsage
The buffer can be used as a destination for query results.
Sourcepub const fn from_bits_truncate(bits: u32) -> BufferUsage
pub const fn from_bits_truncate(bits: u32) -> BufferUsage
Creates a new bitflag set from the given raw bits. Bits not corresponding to any defined flag are kept.
Sourcepub const fn contains(&self, other: BufferUsage) -> bool
pub const fn contains(&self, other: BufferUsage) -> bool
Returns true
if all flags in other
are contained within self
.
Sourcepub const fn intersects(&self, other: BufferUsage) -> bool
pub const fn intersects(&self, other: BufferUsage) -> bool
Returns true
if any flag in other
is contained within self
.
Sourcepub fn insert(&mut self, other: BufferUsage)
pub fn insert(&mut self, other: BufferUsage)
Inserts the flags in other
into self
.
Sourcepub fn remove(&mut self, other: BufferUsage)
pub fn remove(&mut self, other: BufferUsage)
Removes the flags in other
from self
.
Sourcepub fn toggle(&mut self, other: BufferUsage)
pub fn toggle(&mut self, other: BufferUsage)
Toggles the flags in other
in self
.
Sourcepub const fn with(self, other: BufferUsage) -> BufferUsage
pub const fn with(self, other: BufferUsage) -> BufferUsage
Returns a new Self
with other
flags inserted.
Sourcepub const fn without(self, other: BufferUsage) -> BufferUsage
pub const fn without(self, other: BufferUsage) -> BufferUsage
Returns a new Self
with other
flags removed.
Trait Implementations§
Source§impl BitAnd for BufferUsage
impl BitAnd for BufferUsage
Source§type Output = BufferUsage
type Output = BufferUsage
&
operator.Source§fn bitand(self, other: BufferUsage) -> BufferUsage
fn bitand(self, other: BufferUsage) -> BufferUsage
&
operation. Read moreSource§impl BitAndAssign for BufferUsage
impl BitAndAssign for BufferUsage
Source§fn bitand_assign(&mut self, other: BufferUsage)
fn bitand_assign(&mut self, other: BufferUsage)
&=
operation. Read moreSource§impl BitOr for BufferUsage
impl BitOr for BufferUsage
Source§type Output = BufferUsage
type Output = BufferUsage
|
operator.Source§fn bitor(self, other: BufferUsage) -> BufferUsage
fn bitor(self, other: BufferUsage) -> BufferUsage
|
operation. Read moreSource§impl BitOrAssign for BufferUsage
impl BitOrAssign for BufferUsage
Source§fn bitor_assign(&mut self, other: BufferUsage)
fn bitor_assign(&mut self, other: BufferUsage)
|=
operation. Read moreSource§impl BitXor for BufferUsage
impl BitXor for BufferUsage
Source§type Output = BufferUsage
type Output = BufferUsage
^
operator.Source§fn bitxor(self, other: BufferUsage) -> BufferUsage
fn bitxor(self, other: BufferUsage) -> BufferUsage
^
operation. Read moreSource§impl BitXorAssign for BufferUsage
impl BitXorAssign for BufferUsage
Source§fn bitxor_assign(&mut self, other: BufferUsage)
fn bitxor_assign(&mut self, other: BufferUsage)
^=
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§fn default() -> BufferUsage
fn default() -> BufferUsage
Source§impl Hash for BufferUsage
impl Hash for BufferUsage
Source§impl Not for BufferUsage
impl Not for BufferUsage
Source§type Output = BufferUsage
type Output = BufferUsage
!
operator.Source§fn not(self) -> BufferUsage
fn not(self) -> BufferUsage
!
operation. Read moreSource§impl PartialEq for BufferUsage
impl PartialEq for BufferUsage
impl Copy for BufferUsage
impl Eq for BufferUsage
impl StructuralPartialEq for BufferUsage
Auto Trait Implementations§
impl Freeze for BufferUsage
impl RefUnwindSafe for BufferUsage
impl Send for BufferUsage
impl Sync for BufferUsage
impl Unpin for BufferUsage
impl UnwindSafe for BufferUsage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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.