pub struct Buffer<B: Backend> { /* private fields */ }
Expand description
Implementations§
Source§impl<B> Buffer<B>where
B: Backend,
impl<B> Buffer<B>where
B: Backend,
Sourcepub fn assert_device_owner(&self, device: &Device<B>)
pub fn assert_device_owner(&self, device: &Device<B>)
Assert specified device is owner.
Sourcepub fn instance_id(&self) -> InstanceId
pub fn instance_id(&self) -> InstanceId
Get owned id.
Sourcepub fn assert_instance_owner(&self, instance: &Instance<B>)
pub fn assert_instance_owner(&self, instance: &Instance<B>)
Assert specified instance is owner.
Source§impl<B> Buffer<B>where
B: Backend,
impl<B> Buffer<B>where
B: Backend,
Sourcepub unsafe fn create(
device: &Device<B>,
heaps: &mut Heaps<B>,
info: BufferInfo,
memory_usage: impl MemoryUsage,
) -> Result<Self, BufferCreationError>
pub unsafe fn create( device: &Device<B>, heaps: &mut Heaps<B>, info: BufferInfo, memory_usage: impl MemoryUsage, ) -> Result<Self, BufferCreationError>
Create buffer, allocate memory block for it and bind.
§Safety
In order to guarantee that Heap::allocate
will return
memory range owned by this Device
,
this Heaps
instance must always be used with this Device
instance.
Otherwise usage of hal methods must be always valid.
Sourcepub unsafe fn dispose(self, device: &Device<B>, heaps: &mut Heaps<B>)
pub unsafe fn dispose(self, device: &Device<B>, heaps: &mut Heaps<B>)
Dispose of buffer resource. Deallocate memory block.
Sourcepub unsafe fn raw_mut(&mut self) -> &mut B::Buffer
pub unsafe fn raw_mut(&mut self) -> &mut B::Buffer
Get mutable reference to raw buffer resource
Sourcepub fn block(&self) -> &MemoryBlock<B>
pub fn block(&self) -> &MemoryBlock<B>
Get reference to memory block occupied by buffer.
Sourcepub unsafe fn block_mut(&mut self) -> &mut MemoryBlock<B>
pub unsafe fn block_mut(&mut self) -> &mut MemoryBlock<B>
Get mutable reference to memory block occupied by buffer.
Sourcepub fn info(&self) -> &BufferInfo
pub fn info(&self) -> &BufferInfo
Get buffer info.
Sourcepub fn visible(&self) -> bool
pub fn visible(&self) -> bool
Check if this buffer could is bound to CPU visible memory and therefore mappable.
If this function returns false
map
will always return InvalidAccess
.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Buffer<B>
impl<B> RefUnwindSafe for Buffer<B>
impl<B> Send for Buffer<B>
impl<B> Sync for Buffer<B>
impl<B> Unpin for Buffer<B>
impl<B> UnwindSafe for Buffer<B>
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