rendy_memory

Struct Heaps

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

Heaps available on particular physical device.

Implementations§

Source§

impl<B> Heaps<B>
where B: Backend,

Source

pub unsafe fn new<P, H>(types: P, heaps: H) -> Self
where P: IntoIterator<Item = (Properties, u32, HeapsConfig)>, H: IntoIterator<Item = u64>,

This must be called with gfx_hal::memory::Properties fetched from physical device.

Source

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.

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 dispose(self, device: &B::Device)

Dispose of allocator. Cleanup allocators before dropping. Will panic if memory instances are left allocated.

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

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>

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.