Struct wgpu_util::DynamicBuffer [−][src]
pub struct DynamicBuffer { /* fields omitted */ }
A wgpu::Buffer
which dynamically grows based on the contents.
Implementations
impl DynamicBuffer
[src]
impl DynamicBuffer
[src]pub fn new(device: &Device, descriptor: &BufferDescriptor<'_>) -> Self
[src]
pub fn new(device: &Device, descriptor: &BufferDescriptor<'_>) -> Self
[src]Create a new empty buffer.
pub fn new_init(device: &Device, descriptor: &BufferInitDescriptor<'_>) -> Self
[src]
pub fn new_init(device: &Device, descriptor: &BufferInitDescriptor<'_>) -> Self
[src]Create a new buffer with contents.
pub fn upload(&mut self, device: &Device, queue: &Queue, contents: &[u8])
[src]
pub fn upload(&mut self, device: &Device, queue: &Queue, contents: &[u8])
[src]Uploads contents
and resizes the buffer if needed.
If contents
fits, uploads using wgpu::Queue
, otherwise reallocates and uploads using
wgpu::Device
.
pub fn try_upload(
&mut self,
queue: &Queue,
contents: &[u8]
) -> Result<(), BufferAddress>
[src]
pub fn try_upload(
&mut self,
queue: &Queue,
contents: &[u8]
) -> Result<(), BufferAddress>
[src]Uploades data
using wgpu::Queue
without resizing.
Fails if data
doesn’t fit in buffers and returns the size difference.
pub fn upload_by_init(&mut self, device: &Device, contents: &[u8])
[src]
pub fn upload_by_init(&mut self, device: &Device, contents: &[u8])
[src]Allocates a new buffer, replaces the old one and uploades the contents using
wgpu::Device
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DynamicBuffer
impl Send for DynamicBuffer
impl Sync for DynamicBuffer
impl Unpin for DynamicBuffer
impl !UnwindSafe for DynamicBuffer
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more