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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.