Struct vulkano::buffer::BufferUsage[][src]

pub struct BufferUsage {
    pub transfer_source: bool,
    pub transfer_destination: bool,
    pub uniform_texel_buffer: bool,
    pub storage_texel_buffer: bool,
    pub uniform_buffer: bool,
    pub storage_buffer: bool,
    pub index_buffer: bool,
    pub vertex_buffer: bool,
    pub indirect_buffer: bool,
    pub device_address: bool,
}

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, a panic will happen.

Some methods are provided to build BufferUsage structs for some common situations. However there is no restriction in the combination of BufferUsages that can be enabled.

Fields

transfer_source: booltransfer_destination: booluniform_texel_buffer: boolstorage_texel_buffer: booluniform_buffer: boolstorage_buffer: boolindex_buffer: boolvertex_buffer: boolindirect_buffer: booldevice_address: bool

Requires the buffer_device_address feature. If that feature is not enabled, this will be silently ignored.

Implementations

impl BufferUsage[src]

pub const fn none() -> BufferUsage[src]

Builds a BufferUsage with all values set to false.

pub const fn all() -> BufferUsage[src]

Builds a BufferUsage with all values set to true. Can be used for quick prototyping.

pub const fn transfer_source() -> BufferUsage[src]

Builds a BufferUsage with transfer_source set to true and the rest to false.

pub const fn transfer_destination() -> BufferUsage[src]

Builds a BufferUsage with transfer_destination set to true and the rest to false.

pub const fn vertex_buffer() -> BufferUsage[src]

Builds a BufferUsage with vertex_buffer set to true and the rest to false.

pub const fn vertex_buffer_transfer_destination() -> BufferUsage[src]

Builds a BufferUsage with vertex_buffer and transfer_destination set to true and the rest to false.

pub const fn index_buffer() -> BufferUsage[src]

Builds a BufferUsage with index_buffer set to true and the rest to false.

pub const fn index_buffer_transfer_destination() -> BufferUsage[src]

Builds a BufferUsage with index_buffer and transfer_destination set to true and the rest to false.

pub const fn uniform_buffer() -> BufferUsage[src]

Builds a BufferUsage with uniform_buffer set to true and the rest to false.

pub const fn uniform_buffer_transfer_destination() -> BufferUsage[src]

Builds a BufferUsage with uniform_buffer and transfer_destination set to true and the rest to false.

pub const fn indirect_buffer() -> BufferUsage[src]

Builds a BufferUsage with indirect_buffer set to true and the rest to false.

pub const fn indirect_buffer_transfer_destination() -> BufferUsage[src]

Builds a BufferUsage with indirect_buffer and transfer_destination set to true and the rest to false.

pub const fn device_address() -> BufferUsage[src]

Builds a BufferUsage with device_address set to true and the rest to false.

Trait Implementations

impl BitOr<BufferUsage> for BufferUsage[src]

type Output = Self

The resulting type after applying the | operator.

fn bitor(self, rhs: Self) -> Self[src]

Performs the | operation. Read more

impl Clone for BufferUsage[src]

fn clone(&self) -> BufferUsage[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for BufferUsage[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<BufferUsage> for BufferUsage[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &BufferUsage) -> bool[src]

This method tests for !=.

impl Copy for BufferUsage[src]

impl Eq for BufferUsage[src]

impl StructuralEq for BufferUsage[src]

impl StructuralPartialEq for BufferUsage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Content for T[src]

pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]

Builds a pointer to this type from a raw pointer.

pub fn is_size_suitable(usize) -> bool[src]

Returns true if the size is suitable to store a type like this.

pub fn indiv_size() -> usize[src]

Returns the size of an individual element.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.