#[repr(C)]pub struct BufferDescriptor<L> {
pub label: L,
pub size: BufferAddress,
pub usage: BufferUsages,
pub mapped_at_creation: bool,
}Expand description
Describes a Buffer.
Corresponds to WebGPU GPUBufferDescriptor.
Fields§
§label: LDebug label of a buffer. This will show up in graphics debuggers for easy identification.
size: BufferAddressSize of a buffer, in bytes.
usage: BufferUsagesUsages of a buffer. If the buffer is used in any way that isn’t specified here, the operation will panic.
Specifying only usages the application will actually perform may increase performance.
Additionally, on the WebGL backend, there are restrictions on BufferUsages::INDEX;
see DownlevelFlags::UNRESTRICTED_INDEX_BUFFER for more information.
mapped_at_creation: boolAllows 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: Clone> Clone for BufferDescriptor<L>
impl<L: Clone> Clone for BufferDescriptor<L>
Source§fn clone(&self) -> BufferDescriptor<L>
fn clone(&self) -> BufferDescriptor<L>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<L: Debug> Debug for BufferDescriptor<L>
impl<L: Debug> Debug for BufferDescriptor<L>
Source§impl<'de, L> Deserialize<'de> for BufferDescriptor<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for BufferDescriptor<L>where
L: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<L: Hash> Hash for BufferDescriptor<L>
impl<L: Hash> Hash for BufferDescriptor<L>
Source§impl<L: PartialEq> PartialEq for BufferDescriptor<L>
impl<L: PartialEq> PartialEq for BufferDescriptor<L>
Source§impl<L> Serialize for BufferDescriptor<L>where
L: Serialize,
impl<L> Serialize for BufferDescriptor<L>where
L: Serialize,
impl<L: Eq> Eq for BufferDescriptor<L>
impl<L> StructuralPartialEq for BufferDescriptor<L>
Auto Trait Implementations§
impl<L> Freeze for BufferDescriptor<L>where
L: Freeze,
impl<L> RefUnwindSafe for BufferDescriptor<L>where
L: RefUnwindSafe,
impl<L> Send for BufferDescriptor<L>where
L: Send,
impl<L> Sync for BufferDescriptor<L>where
L: Sync,
impl<L> Unpin for BufferDescriptor<L>where
L: Unpin,
impl<L> UnwindSafe for BufferDescriptor<L>where
L: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)