pub struct Buffer<T> {
pub raw: Buffer,
/* private fields */
}
Expand description
A helper struct for a wgpu::Buffer
.
Fields§
§raw: Buffer
Implementations§
Source§impl<T: Pod> Buffer<T>
impl<T: Pod> Buffer<T>
pub fn new( device: &Device, label: &'static str, amount: usize, usage: BufferUsages, ) -> Self
Sourcepub fn expand_to_fit_new_size(
&mut self,
device: &Device,
new_count: usize,
) -> bool
pub fn expand_to_fit_new_size( &mut self, device: &Device, new_count: usize, ) -> bool
Returns true
if the buffer was expanded.
Sourcepub fn write(&mut self, queue: &Queue, offset: usize, contents: &[T]) -> usize
pub fn write(&mut self, queue: &Queue, offset: usize, contents: &[T]) -> usize
Returns the size of the written bytes.
pub fn slice(&self, range: Range<usize>) -> BufferSlice<'_>
pub fn label(&self) -> &'static str
Auto Trait Implementations§
impl<T> !Freeze for Buffer<T>
impl<T> !RefUnwindSafe for Buffer<T>
impl<T> Send for Buffer<T>where
T: Send,
impl<T> Sync for Buffer<T>where
T: Sync,
impl<T> Unpin for Buffer<T>where
T: Unpin,
impl<T> !UnwindSafe for Buffer<T>
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