Type Alias wgpu::BufferDescriptor
source · pub type BufferDescriptor<'a> = BufferDescriptor<Label<'a>>;
Expand description
Aliased Type§
struct BufferDescriptor<'a> {
pub label: Option<&'a str>,
pub size: u64,
pub usage: BufferUsages,
pub mapped_at_creation: bool,
}
Fields§
§label: Option<&'a str>
Debug label of a buffer. This will show up in graphics debuggers for easy identification.
size: u64
Size of a buffer, in bytes.
usage: BufferUsages
Usages of a buffer. If the buffer is used in any way that isn’t specified here, the operation will panic.
mapped_at_creation: bool
Allows a buffer to be mapped immediately after they are made. It does not have to be [BufferUsages::MAP_READ
] or
[BufferUsages::MAP_WRITE
], all buffers are allowed to be mapped at creation.
If this is true
, size
must be a multiple of
[COPY_BUFFER_ALIGNMENT
].
Implementations
source§impl<L> BufferDescriptor<L>
impl<L> BufferDescriptor<L>
sourcepub fn map_label<K>(&self, fun: impl FnOnce(&L) -> K) -> BufferDescriptor<K>
pub fn map_label<K>(&self, fun: impl FnOnce(&L) -> K) -> BufferDescriptor<K>
Takes a closure and maps the label of the buffer descriptor into another.
Trait Implementations
source§impl<L> Debug for BufferDescriptor<L>where
L: Debug,
impl<L> Debug for BufferDescriptor<L>where
L: Debug,
source§impl<L> PartialEq for BufferDescriptor<L>where
L: PartialEq,
impl<L> PartialEq for BufferDescriptor<L>where
L: PartialEq,
source§fn eq(&self, other: &BufferDescriptor<L>) -> bool
fn eq(&self, other: &BufferDescriptor<L>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<L> Eq for BufferDescriptor<L>where
L: Eq,
impl<L> StructuralPartialEq for BufferDescriptor<L>
source§impl<L> Clone for BufferDescriptor<L>where
L: Clone,
impl<L> Clone for BufferDescriptor<L>where
L: Clone,
source§fn clone(&self) -> BufferDescriptor<L>
fn clone(&self) -> BufferDescriptor<L>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more