[][src]Function gaclen::graphics::buffer::copy

pub fn copy<S, D, T>(device: &Device, source: S, destination: D) where
    S: TypedBufferAccess<Content = T> + Send + Sync + 'static,
    D: TypedBufferAccess<Content = T> + Send + Sync + 'static,
    T: ?Sized

Copies data from one buffer to another.

Builds a command buffer for copying the data and executes it.

Notes

  • The source buffer should have BufferUsage::transfer_source set to true.
  • The destination buffer should have BufferUsage::transfer_destination set to true.
  • If the sizes of buffers are not equal the amount of data copies will be equal to the smaller of the two sizes.

Panic

  • Panics if fails to create the command buffer.
  • Panics if fails to submit the command buffer.