pub struct AutomatedBuffer { /* private fields */ }
Expand description
A buffer which automatically uses either staging buffers or direct mapping to write to its
internal buffer based on the provided UploadStyle
.
Implementations§
Source§impl AutomatedBuffer
impl AutomatedBuffer
pub fn stats(&self) -> AutomatedBufferStats
Sourcepub fn get_current_inner(&self) -> Arc<IdBuffer>
pub fn get_current_inner(&self) -> Arc<IdBuffer>
Buffer that should be used in bind groups to access the data in the buffer.
Every single time write_to_buffer
is called,
this could change and the bind group needs to be remade. The BindGroupCache
can
help streamline this process and re-use bind groups.
Sourcepub fn write_to_buffer<DataFn>(
&mut self,
device: &Device,
encoder: &mut CommandEncoder,
size: BufferAddress,
data_fn: DataFn,
)
pub fn write_to_buffer<DataFn>( &mut self, device: &Device, encoder: &mut CommandEncoder, size: BufferAddress, data_fn: DataFn, )
Writes to the underlying buffer using the proper write style.
The buffer will be resized to the given size
.
All needed copy operations will be recorded onto encoder
.
Once the buffer is mapped and ready to be written to, the slice of exactly
size
bytes will be provided to data_fn
to be written in.
Trait Implementations§
Source§impl<'buf> AutomatedBufferSet<'buf> for &'buf AutomatedBuffer
impl<'buf> AutomatedBufferSet<'buf> for &'buf AutomatedBuffer
Auto Trait Implementations§
impl Freeze for AutomatedBuffer
impl !RefUnwindSafe for AutomatedBuffer
impl Send for AutomatedBuffer
impl Sync for AutomatedBuffer
impl Unpin for AutomatedBuffer
impl !UnwindSafe for AutomatedBuffer
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