logo
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,
    pub _ne: NonExhaustive,
}
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, 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_ne: NonExhaustive

Implementations

Builds a BufferUsage with all values set to false.

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

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

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

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

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

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

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

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

Builds a BufferUsage with only storage_buffer set, while rest are not

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

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

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

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

Trait Implementations

The resulting type after applying the | operator.

Performs the | operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.