pub struct Heaps<B: Backend> { /* private fields */ }
Expand description
Heaps available on particular physical device.
Implementations§
Source§impl<B> Heaps<B>where
B: Backend,
impl<B> Heaps<B>where
B: Backend,
Sourcepub unsafe fn new<P, H>(types: P, heaps: H) -> Self
pub unsafe fn new<P, H>(types: P, heaps: H) -> Self
This must be called with gfx_hal::memory::Properties
fetched from physical device.
Sourcepub fn allocate(
&mut self,
device: &B::Device,
mask: u32,
usage: impl MemoryUsage,
size: u64,
align: u64,
) -> Result<MemoryBlock<B>, HeapsError>
pub fn allocate( &mut self, device: &B::Device, mask: u32, usage: impl MemoryUsage, size: u64, align: u64, ) -> Result<MemoryBlock<B>, HeapsError>
Allocate memory block
from one of memory types specified by mask
,
for intended usage
,
with size
and align
requirements.
Sourcepub fn free(&mut self, device: &B::Device, block: MemoryBlock<B>)
pub fn free(&mut self, device: &B::Device, block: MemoryBlock<B>)
Free memory block.
Memory block must be allocated from this heap.
Sourcepub fn dispose(self, device: &B::Device)
pub fn dispose(self, device: &B::Device)
Dispose of allocator. Cleanup allocators before dropping. Will panic if memory instances are left allocated.
Sourcepub fn utilization(&self) -> TotalMemoryUtilization
pub fn utilization(&self) -> TotalMemoryUtilization
Get memory utilization.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Heaps<B>
impl<B> RefUnwindSafe for Heaps<B>
impl<B> Send for Heaps<B>
impl<B> Sync for Heaps<B>
impl<B> Unpin for Heaps<B>
impl<B> UnwindSafe for Heaps<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