pub struct Buffer { /* private fields */ }Expand description
A GPU storage buffer (host-visible).
Implementations§
Source§impl Buffer
impl Buffer
pub fn len(&self) -> usize
Sourcepub fn is_unique(&self) -> bool
pub fn is_unique(&self) -> bool
Whether this handle is the buffer’s only one (nothing else, a frame in flight included, still holds it).
pub fn is_empty(&self) -> bool
Sourcepub unsafe fn mapped(&self) -> &mut [u8] ⓘ
pub unsafe fn mapped(&self) -> &mut [u8] ⓘ
The buffer’s memory, for filling it from the CPU in place (a
decoder reading frames straight into GPU-visible memory). Writers
report the bytes with Device::note_upload.
§Safety
No GPU work may access the buffer, and no other slice of it may be alive, while the returned slice is.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Buffer
impl Freeze for Buffer
impl Move for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnsafeUnpin for Buffer
impl UnwindSafe for Buffer
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