Heaps

Struct Heaps 

Source
pub struct Heaps<B: Backend> { /* private fields */ }
Expand description

Heaps available on particular physical device.

Implementations§

Source§

impl<B: Backend> Heaps<B>

Source

pub unsafe fn new( hal_memory_properties: &MemoryProperties, config_general: GeneralConfig, config_linear: LinearConfig, non_coherent_atom_size: Size, ) -> Self

Initialize the new Heaps object.

§Safety

All later operations assume the device is not lost.

Source

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.

Source

pub fn free(&mut self, device: &B::Device, block: MemoryBlock<B>)

Free memory block.

Memory block must be allocated from this heap.

Source

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.

Source

pub fn utilization(&self) -> TotalMemoryUtilization

Get memory utilization.

Trait Implementations§

Source§

impl<B: Debug + Backend> Debug for Heaps<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B: Backend> Drop for Heaps<B>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<B> Freeze for Heaps<B>

§

impl<B> RefUnwindSafe for Heaps<B>
where <B as Backend>::Memory: RefUnwindSafe,

§

impl<B> Send for Heaps<B>

§

impl<B> Sync for Heaps<B>

§

impl<B> Unpin for Heaps<B>

§

impl<B> UnwindSafe for Heaps<B>
where <B as Backend>::Memory: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.