[][src]Struct wgpu_conveyor::AutomatedBuffer

pub struct AutomatedBuffer { /* fields omitted */ }

A buffer which automatically uses either staging buffers or direct mapping to write to its internal buffer based on the provided UploadStyle.

Implementations

impl AutomatedBuffer[src]

pub fn stats(&self) -> AutomatedBufferStats[src]

pub fn get_current_inner(&self) -> Arc<IdBuffer>[src]

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.

pub fn write_to_buffer<DataFn>(
    &mut self,
    device: &Device,
    encoder: &mut CommandEncoder,
    size: BufferAddress,
    data_fn: DataFn
) where
    DataFn: FnOnce(&mut [u8]), 
[src]

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

impl<'buf> AutomatedBufferSet<'buf> for &'buf AutomatedBuffer[src]

type Key = BeltBufferId

Key type corresponding to this buffer type. Read more

type Value = Arc<IdBuffer>

Underlying buffer type.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.