1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! TLSF-based Vulkan 1.4 memory allocator for devices using `VK_EXT_descriptor_heap`.
//!
//! ```ignore
//! let allocator = unsafe { Allocator::new(&instance, physical_device, &device_cmds, device, &AllocatorConfig::default())? };
//! let mut buffer = allocator.create_buffer(&BufferDesc {
//! size: 1 << 20,
//! usage: VkBufferUsageFlags2::STORAGE_BUFFER,
//! location: MemoryLocation::CpuToGpu,
//! })?;
//! buffer.mapped_slice_mut().unwrap().fill(0);
//! let range = buffer.range(); // feed into VkResourceDescriptorInfoEXT
//! allocator.destroy_buffer(buffer);
//! ```
mod allocator;
mod device;
mod error;
mod resource;
mod tlsf;
mod virtual_block;
pub use allocator::{
Allocation, AllocationDesc, Allocator, AllocatorConfig, HeapBudget, MemoryLocation,
ResourceKind, Statistics,
};
pub use error::{Error, Result};
pub use resource::{Buffer, BufferDesc, DescriptorHeap, DescriptorHeapKind, Image};
pub use virtual_block::{VirtualAllocation, VirtualBlock};