Struct vk_alloc::Allocator [−][src]
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]
instance: &InstanceLoader,
physical_device: PhysicalDevice,
descriptor: &AllocatorDescriptor
) -> Self
Creates a new allocator.
pub fn allocate_memory_for_buffer(
&self,
device: &DeviceLoader,
buffer: Buffer,
location: MemoryLocation
) -> Result<Allocation, AllocatorError>
[src]
&self,
device: &DeviceLoader,
buffer: Buffer,
location: MemoryLocation
) -> Result<Allocation, AllocatorError>
Allocates memory for a buffer.
pub fn allocate_memory_for_image(
&self,
device: &DeviceLoader,
image: Image,
location: MemoryLocation
) -> Result<Allocation, AllocatorError>
[src]
&self,
device: &DeviceLoader,
image: Image,
location: MemoryLocation
) -> Result<Allocation, AllocatorError>
Allocates memory for an image.
pub fn allocate(
&self,
device: &DeviceLoader,
descriptor: &AllocationDescriptor
) -> Result<Allocation, AllocatorError>
[src]
&self,
device: &DeviceLoader,
descriptor: &AllocationDescriptor
) -> Result<Allocation, AllocatorError>
Allocates memory on the allocator.
pub fn deallocate(
&self,
device: &DeviceLoader,
allocation: &Allocation
) -> Result<(), AllocatorError>
[src]
&self,
device: &DeviceLoader,
allocation: &Allocation
) -> Result<(), AllocatorError>
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
Auto Trait Implementations
impl RefUnwindSafe for Allocator
impl Send for Allocator
impl Sync for Allocator
impl Unpin for Allocator
impl UnwindSafe for Allocator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,