Struct vk_alloc::Allocator[][src]

pub struct Allocator { /* fields omitted */ }

The general purpose memory allocator. Implemented as a segregated list allocator.

Implementations

impl Allocator[src]

pub fn new(
    instance: &InstanceLoader,
    physical_device: PhysicalDevice,
    descriptor: &AllocatorDescriptor
) -> Self
[src]

Creates a new allocator.

pub fn allocate_memory_for_buffer(
    &self,
    device: &DeviceLoader,
    buffer: Buffer,
    location: MemoryLocation
) -> Result<Allocation, AllocatorError>
[src]

Allocates memory for a buffer.

pub fn allocate_memory_for_image(
    &self,
    device: &DeviceLoader,
    image: Image,
    location: MemoryLocation
) -> Result<Allocation, AllocatorError>
[src]

Allocates memory for an image.

pub fn allocate(
    &self,
    device: &DeviceLoader,
    descriptor: &AllocationDescriptor
) -> Result<Allocation, AllocatorError>
[src]

Allocates memory on the allocator.

pub fn deallocate(
    &self,
    device: &DeviceLoader,
    allocation: &Allocation
) -> Result<(), AllocatorError>
[src]

Frees the allocation.

pub fn cleanup(&mut self, device: &DeviceLoader)[src]

Releases all memory blocks back to the system. Should be called before drop.

pub fn allocation_count(&self) -> usize[src]

Number of allocations.

pub fn unused_range_count(&self) -> usize[src]

Number of unused ranges between allocations.

pub fn used_bytes(&self) -> DeviceSize[src]

Number of bytes used by the allocations.

pub fn unused_bytes(&self) -> DeviceSize[src]

Number of bytes used by the unused ranges between allocations.

pub fn block_count(&self) -> usize[src]

Number of allocated Vulkan memory blocks.

Trait Implementations

impl Debug for Allocator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.