pub struct VulkanSuballocator { /* private fields */ }Implementations§
Source§impl VulkanSuballocator
impl VulkanSuballocator
pub fn new() -> Self
pub fn allocate( &mut self, device: &Device, size: u64, alignment: u64, memory_type_index: u32, is_host_visible: bool, is_coherent: bool, allocation_type: AllocationType, ) -> Result<AllocationResult, HalError>
pub fn free(&mut self, block_id: usize, offset: u64, size: u64, device: &Device)
Sourcepub fn trim(&mut self, device: &Device) -> usize
pub fn trim(&mut self, device: &Device) -> usize
Reclaims ALL completely empty blocks, releasing their GPU and host memory back to Vulkan. Returns the number of reclaimed blocks.
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Returns the total number of blocks currently held by the suballocator.
Sourcepub fn empty_block_count(&self) -> usize
pub fn empty_block_count(&self) -> usize
Returns the number of completely empty blocks currently held by the suballocator.
Sourcepub fn total_capacity_bytes(&self) -> u64
pub fn total_capacity_bytes(&self) -> u64
Returns the total capacity in bytes across all managed blocks.
Sourcepub fn total_free_bytes(&self) -> u64
pub fn total_free_bytes(&self) -> u64
Returns the total available free bytes across all managed blocks.
pub fn destroy(&mut self, device: &Device)
Auto Trait Implementations§
impl Freeze for VulkanSuballocator
impl RefUnwindSafe for VulkanSuballocator
impl Send for VulkanSuballocator
impl Sync for VulkanSuballocator
impl Unpin for VulkanSuballocator
impl UnsafeUnpin for VulkanSuballocator
impl UnwindSafe for VulkanSuballocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more