Struct 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

Source

pub const TRANSFER_SRC: Self

The buffer can be used as a source for transfer, blit, resolve and clear commands.

Source

pub const TRANSFER_DST: Self

The buffer can be used as a destination for transfer, blit, resolve and clear commands.

Source

pub const UNIFORM_TEXEL_BUFFER: Self

The buffer can be used as a uniform texel buffer in a descriptor set.

Source

pub const STORAGE_TEXEL_BUFFER: Self

The buffer can be used as a storage texel buffer in a descriptor set.

Source

pub const UNIFORM_BUFFER: Self

The buffer can be used as a uniform buffer in a descriptor set.

Source

pub const STORAGE_BUFFER: Self

The buffer can be used as a storage buffer in a descriptor set.

Source

pub const INDEX_BUFFER: Self

The buffer can be used as an index buffer.

Source

pub const VERTEX_BUFFER: Self

The buffer can be used as a vertex or instance buffer.

Source

pub const INDIRECT_BUFFER: Self

The buffer can be used as an indirect buffer.

Source

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.

Source

pub const ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY: Self

The buffer can be used as input data for an acceleration structure build operation.

Source

pub const ACCELERATION_STRUCTURE_STORAGE: Self

An acceleration structure can be created from the buffer.

Source

pub const SHADER_BINDING_TABLE: Self

Source

pub const fn empty() -> Self

Returns a BufferUsage with none of the flags set.

Source

pub const fn count(self) -> u32

Returns the number of flags set in self.

Source

pub const fn is_empty(self) -> bool

Returns whether no flags are set in self.

Source

pub const fn intersects(self, other: Self) -> bool

Returns whether any flags are set in both self and other.

Source

pub const fn contains(self, other: Self) -> bool

Returns whether all flags in other are set in self.

Source

pub const fn union(self, other: Self) -> Self

Returns the union of self and other.

Source

pub const fn intersection(self, other: Self) -> Self

Returns the intersection of self and other.

Source

pub const fn difference(self, other: Self) -> Self

Returns self without the flags set in other.

Source

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

Source§

type Output = BufferUsage

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl BitAndAssign for BufferUsage

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for BufferUsage

Source§

type Output = BufferUsage

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl BitOrAssign for BufferUsage

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for BufferUsage

Source§

type Output = BufferUsage

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
Source§

impl BitXorAssign for BufferUsage

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for BufferUsage

Source§

fn clone(&self) -> BufferUsage

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BufferUsage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for BufferUsage

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<BufferUsage> for BufferUsageFlags

Source§

fn from(val: BufferUsage) -> Self

Converts to this type from the input type.
Source§

impl From<BufferUsageFlags> for BufferUsage

Source§

fn from(val: BufferUsageFlags) -> Self

Converts to this type from the input type.
Source§

impl Hash for BufferUsage

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BufferUsage

Source§

fn eq(&self, other: &BufferUsage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub for BufferUsage

Source§

type Output = BufferUsage

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl SubAssign for BufferUsage

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl Copy for BufferUsage

Source§

impl Eq for BufferUsage

Source§

impl StructuralPartialEq for BufferUsage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.