Struct sierra::MappableBuffer
source · #[repr(transparent)]pub struct MappableBuffer { /* private fields */ }
Expand description
Handle to GPU buffer object.
Variation of Buffer
which is not shared
and thus can be mapped onto host memory.
Mapping of shared buffer is forbidden due to requirement of GPU driver to map any memory object at most once. This allows accessing mapped memory safely without causing data races.
If buffer sharing is required and mapping is not,
[MappedBuffer
] can be converted into Buffer
with no cost.
Implementations§
Methods from Deref<Target = Buffer>§
pub fn info(&self) -> &BufferInfo
pub fn address(&self) -> Option<DeviceAddress>
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 Debug for MappableBuffer
impl Debug for MappableBuffer
source§impl Deref for MappableBuffer
impl Deref for MappableBuffer
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.