pub struct Buffer<'a> { /* private fields */ }Expand description
A buffer for sharing data between the CPU and GPU.
Create a buffer using the Device::create_buffer method.
Implementations§
Source§impl<'a> Buffer<'a>
impl<'a> Buffer<'a>
Sourcepub fn output(&self) -> bool
pub fn output(&self) -> bool
Check if the buffer is an output buffer (i.e., readable from the CPU after being used by the GPU) or not.
Sourcepub fn data(&self) -> Option<&Vec<u8>>
pub fn data(&self) -> Option<&Vec<u8>>
Get a reference to the data stored in the buffer (as bytes).
Sourcepub fn buffer_type(&self) -> BufferType
pub fn buffer_type(&self) -> BufferType
Get the type of the buffer.
Sourcepub fn write<T>(&self, data: &T)where
T: ShaderType + WriteInto,
pub fn write<T>(&self, data: &T)where
T: ShaderType + WriteInto,
Write data to the buffer.
Auto Trait Implementations§
impl<'a> !Freeze for Buffer<'a>
impl<'a> !RefUnwindSafe for Buffer<'a>
impl<'a> !Send for Buffer<'a>
impl<'a> !Sync for Buffer<'a>
impl<'a> Unpin for Buffer<'a>
impl<'a> !UnwindSafe for Buffer<'a>
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