pub struct Buffer { /* private fields */ }
Expand description
Handle for GPU buffer object. GPU buffer is an object representing contiguous array of bytes accessible by GPU operations.
Implementations§
source§impl Buffer
impl Buffer
pub fn info(&self) -> &BufferInfo
pub fn address(&self) -> Option<DeviceAddress>
pub fn try_into_mappable(self) -> Result<MappableBuffer, Self>
sourcepub unsafe fn into_mappable(self) -> MappableBuffer
pub unsafe fn into_mappable(self) -> MappableBuffer
Safety
Caller must ensure that writes would not create races.
pub fn try_as_mappable(&mut self) -> Option<&mut MappableBuffer>
sourcepub unsafe fn as_mappable(&mut self) -> &mut MappableBuffer
pub unsafe fn as_mappable(&mut self) -> &mut MappableBuffer
Safety
Caller must ensure that writes would not create races.
sourcepub fn is_unused(&self) -> bool
pub fn is_unused(&self) -> bool
Check if buffer is unused. Caller should have exclusive access to the reference, otherwise buffer can be used at any moment.
pub fn is_mappable(&self) -> bool
Trait Implementations§
source§impl From<Buffer> for BufferRange
impl From<Buffer> for BufferRange
source§impl From<MappableBuffer> for Buffer
impl From<MappableBuffer> for Buffer
source§fn from(buffer: MappableBuffer) -> Self
fn from(buffer: MappableBuffer) -> Self
Converts to this type from the input type.