Struct vk_alloc::Allocator [−][src]
pub struct Allocator<LT: Lifetime> { /* fields omitted */ }
Expand description
The general purpose memory allocator. Implemented as a segregated list allocator.
Implementations
pub fn new(
instance: &InstanceLoader,
physical_device: PhysicalDevice,
descriptor: &AllocatorDescriptor
) -> Result<Self, AllocatorError>
pub fn new(
instance: &InstanceLoader,
physical_device: PhysicalDevice,
descriptor: &AllocatorDescriptor
) -> Result<Self, AllocatorError>
Creates a new allocator.
pub fn allocate_memory_for_buffer(
&self,
device: &DeviceLoader,
buffer: Buffer,
location: MemoryLocation,
lifetime: LT
) -> Result<Allocation<LT>, AllocatorError>
pub fn allocate_memory_for_buffer(
&self,
device: &DeviceLoader,
buffer: Buffer,
location: MemoryLocation,
lifetime: LT
) -> Result<Allocation<LT>, AllocatorError>
Allocates memory for a buffer.
pub fn allocate_memory_for_image(
&self,
device: &DeviceLoader,
image: Image,
location: MemoryLocation,
lifetime: LT,
is_optimal: bool
) -> Result<Allocation<LT>, AllocatorError>
pub fn allocate_memory_for_image(
&self,
device: &DeviceLoader,
image: Image,
location: MemoryLocation,
lifetime: LT,
is_optimal: bool
) -> Result<Allocation<LT>, AllocatorError>
Allocates memory for an image. is_optimal
must be set true if the image is a optimal image (a regular texture).
pub fn allocate(
&self,
device: &DeviceLoader,
descriptor: &AllocationDescriptor<LT>
) -> Result<Allocation<LT>, AllocatorError>
pub fn allocate(
&self,
device: &DeviceLoader,
descriptor: &AllocationDescriptor<LT>
) -> Result<Allocation<LT>, AllocatorError>
Allocates memory on the allocator.
pub fn deallocate(
&self,
device: &DeviceLoader,
allocation: &Allocation<LT>
) -> Result<(), AllocatorError>
pub fn deallocate(
&self,
device: &DeviceLoader,
allocation: &Allocation<LT>
) -> Result<(), AllocatorError>
Frees the allocation.
Releases all memory blocks back to the system. Should be called before drop.
Number of allocations.
Number of unused ranges between allocations.
Number of bytes used by the allocations.
Number of bytes used by the unused ranges between allocations.
Number of allocated Vulkan memory blocks.
Trait Implementations
Auto Trait Implementations
impl<LT> !RefUnwindSafe for Allocator<LT>
impl<LT> UnwindSafe for Allocator<LT> where
LT: UnwindSafe,