pub struct Heaps<B: Backend> { /* private fields */ }
Expand description
Heaps available on particular physical device.
Implementations§
Source§impl<B: Backend> Heaps<B>
impl<B: Backend> Heaps<B>
Sourcepub unsafe fn new(
hal_memory_properties: &MemoryProperties,
config_general: GeneralConfig,
config_linear: LinearConfig,
non_coherent_atom_size: Size,
) -> Self
pub unsafe fn new( hal_memory_properties: &MemoryProperties, config_general: GeneralConfig, config_linear: LinearConfig, non_coherent_atom_size: Size, ) -> Self
Sourcepub fn allocate(
&mut self,
device: &B::Device,
requirements: &Requirements,
usage: MemoryUsage,
kind: Kind,
) -> Result<MemoryBlock<B>, HeapsError>
pub fn allocate( &mut self, device: &B::Device, requirements: &Requirements, usage: MemoryUsage, kind: Kind, ) -> Result<MemoryBlock<B>, HeapsError>
Allocate memory block give the requirements
from gfx-hal.
for intended usage
, using the kind
of allocator.
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 clear(&mut self, device: &B::Device)
pub fn clear(&mut self, device: &B::Device)
Clear allocators.
Call this before dropping an instance of Heaps
or if you are low on memory.
Internally calls the clear methods on all
internal LinearAllocator
and GeneralAllocator
instances.
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