pub struct BufferPool { /* private fields */ }
Expand description
A wgpu::Buffer
Pool (dynamic supply).
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn new(descriptor: &BufferPoolDescriptor<'_>) -> Self
pub fn new(descriptor: &BufferPoolDescriptor<'_>) -> Self
Creates a new empty pool.
Sourcepub fn upload(
&mut self,
device: &Device,
queue: &Queue,
contents: &[u8],
) -> usize
pub fn upload( &mut self, device: &Device, queue: &Queue, contents: &[u8], ) -> usize
Upload contents to a vacant buffer.
Returns buffer index. If no vacant buffer is available, a new one is allocated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferPool
impl !RefUnwindSafe for BufferPool
impl Send for BufferPool
impl Sync for BufferPool
impl Unpin for BufferPool
impl !UnwindSafe for BufferPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more