pub struct Buffer<LT: Lifetime> { /* private fields */ }
Expand description
Wraps a buffer.
Implementations§
Source§impl<LT: Lifetime> Buffer<LT>
impl<LT: Lifetime> Buffer<LT>
Sourcepub unsafe fn mapped_slice(&self) -> Result<Option<&[u8]>, AscheError>
pub unsafe fn mapped_slice(&self) -> Result<Option<&[u8]>, AscheError>
Returns a valid mapped slice if the buffer memory is host visible, otherwise it will return None.
Sourcepub unsafe fn mapped_slice_mut(
&mut self,
) -> Result<Option<&mut [u8]>, AscheError>
pub unsafe fn mapped_slice_mut( &mut self, ) -> Result<Option<&mut [u8]>, AscheError>
Returns a valid mapped mutable slice if the buffer memory is host visible, otherwise it will return None.
Sourcepub unsafe fn flush(&self) -> Result<(), AscheError>
pub unsafe fn flush(&self) -> Result<(), AscheError>
Flush the mapped memory of the buffer. Used for CPU->GPU transfers. Vulkan Manual Page
Sourcepub unsafe fn invalidate(&self) -> Result<(), AscheError>
pub unsafe fn invalidate(&self) -> Result<(), AscheError>
Invalidate the mapped memory of the buffer. Used for GPU->CPU transfers. Vulkan Manual Page
Sourcepub unsafe fn device_address(&self) -> DeviceAddress
pub unsafe fn device_address(&self) -> DeviceAddress
Query an address of a buffer. Vulkan Manual Page
Trait Implementations§
Auto Trait Implementations§
impl<LT> Freeze for Buffer<LT>where
LT: Freeze,
impl<LT> !RefUnwindSafe for Buffer<LT>
impl<LT> Send for Buffer<LT>
impl<LT> Sync for Buffer<LT>
impl<LT> Unpin for Buffer<LT>where
LT: Unpin,
impl<LT> !UnwindSafe for Buffer<LT>
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