#[repr(C)]
pub struct VmaDefragmentationPassMoveInfo { pub moveCount: u32, pub pMoves: *mut VmaDefragmentationMove, }
Expand description

\brief Parameters for incremental defragmentation steps.

To be used with function vmaBeginDefragmentationPass().

Fields

moveCount: u32

Number of elements in the pMoves array.

pMoves: *mut VmaDefragmentationMove

\brief Array of moves to be performed by the user in the current defragmentation pass.

Pointer to an array of moveCount elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().

For each element, you should:

  1. Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset.
  2. Copy data from the VmaDefragmentationMove::srcAllocation e.g. using vkCmdCopyBuffer, vkCmdCopyImage.
  3. Make sure these commands finished executing on the GPU.
  4. Destroy the old buffer/image.

Only then you can finish defragmentation pass by calling vmaEndDefragmentationPass(). After this call, the allocation will point to the new place in memory.

Alternatively, if you cannot move specific allocation, you can set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE.

Alternatively, if you decide you want to completely remove the allocation:

  1. Destroy its buffer/image.
  2. Set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY.

Then, after vmaEndDefragmentationPass() the allocation will be freed.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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.