pub struct GpuBuffer { /* private fields */ }Expand description
GPU buffer wrapper with automatic memory management
Implementations§
Source§impl GpuBuffer
impl GpuBuffer
Sourcepub async fn read_async(
&self,
_device: &GpuDevice,
offset: u64,
size: u64,
) -> Result<Vec<u8>>
pub async fn read_async( &self, _device: &GpuDevice, offset: u64, size: u64, ) -> Result<Vec<u8>>
Sourcepub fn buffer_type(&self) -> BufferType
pub fn buffer_type(&self) -> BufferType
Get buffer type
Sourcepub fn copy_to(
&self,
encoder: &mut CommandEncoder,
dst: &Self,
src_offset: u64,
dst_offset: u64,
size: u64,
) -> Result<()>
pub fn copy_to( &self, encoder: &mut CommandEncoder, dst: &Self, src_offset: u64, dst_offset: u64, size: u64, ) -> Result<()>
Copy data from this buffer to another buffer
§Arguments
encoder- Command encoder for recording the copy operationdst- Destination buffersrc_offset- Source offset in bytesdst_offset- Destination offset in bytessize- Number of bytes to copy
§Errors
Returns an error if offsets or size are invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuBuffer
impl !RefUnwindSafe for GpuBuffer
impl Send for GpuBuffer
impl Sync for GpuBuffer
impl Unpin for GpuBuffer
impl UnsafeUnpin for GpuBuffer
impl !UnwindSafe for GpuBuffer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more