Skip to main content

staging_buffer

Function staging_buffer 

Source
pub fn staging_buffer(device: &Device, label: &str, size: u64) -> Buffer
Expand description

Create an empty CPU-mappable staging buffer of size bytes.

The returned buffer has usage MAP_READ | COPY_DST:

  • COPY_DST — accept a copy_buffer_to_buffer from a storage/output buffer.
  • MAP_READ — allows buffer.slice(..).map_async(MapMode::Read, …).

§Panics

Panics if size is zero.