Struct vk_mem_erupt::DefragmentationInfo2 [−][src]
pub struct DefragmentationInfo2<'a> { pub allocations: &'a [Allocation], pub pools: Option<&'a [AllocatorPool]>, pub max_cpu_bytes_to_move: DeviceSize, pub max_cpu_allocations_to_move: u32, pub max_gpu_bytes_to_move: DeviceSize, pub max_gpu_allocations_to_move: u32, pub command_buffer: Option<CommandBuffer>, }
Expand description
Parameters for defragmentation.
To be used with function Allocator::defragmentation_begin
.
Fields
allocations: &'a [Allocation]
Collection of allocations that can be defragmented.
Elements in the slice should be unique - same allocation cannot occur twice. It is safe to pass allocations that are in the lost state - they are ignored. All allocations not present in this slice are considered non-moveable during this defragmentation.
pools: Option<&'a [AllocatorPool]>
Either None
or a slice of pools to be defragmented.
All the allocations in the specified pools can be moved during defragmentation
and there is no way to check if they were really moved as in allocations_changed
,
so you must query all the allocations in all these pools for new erupt::vk::DeviceMemory
and offset using Allocator::get_allocation_info
if you might need to recreate buffers
and images bound to them.
Elements in the array should be unique - same pool cannot occur twice.
Using this array is equivalent to specifying all allocations from the pools in allocations
.
It might be more efficient.
max_cpu_bytes_to_move: DeviceSize
Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like memcpy()
, memmove()
.
erupt::vk::WHOLE_SIZE
means no limit.
max_cpu_allocations_to_move: u32
Maximum number of allocations that can be moved to a different place using transfers on CPU side, like memcpy()
, memmove()
.
std::u32::MAX
means no limit.
max_gpu_bytes_to_move: DeviceSize
Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to command_buffer
.
erupt::vk::WHOLE_SIZE
means no limit.
max_gpu_allocations_to_move: u32
Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to command_buffer
.
std::u32::MAX
means no limit.
command_buffer: Option<CommandBuffer>
Command buffer where GPU copy commands will be posted.
If not None
, it must be a valid command buffer handle that supports transfer queue type.
It must be in the recording state and outside of a render pass instance.
You need to submit it and make sure it finished execution before calling Allocator::defragmentation_end
.
Passing None
means that only CPU defragmentation will be performed.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for DefragmentationInfo2<'a>
impl<'a> !Send for DefragmentationInfo2<'a>
impl<'a> !Sync for DefragmentationInfo2<'a>
impl<'a> Unpin for DefragmentationInfo2<'a>
impl<'a> UnwindSafe for DefragmentationInfo2<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more