Struct vk_mem_alloc::ffi::VmaDefragmentationPassMoveInfo
source · [−]#[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:
- Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset.
- Copy data from the VmaDefragmentationMove::srcAllocation e.g. using
vkCmdCopyBuffer
,vkCmdCopyImage
. - Make sure these commands finished executing on the GPU.
- 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:
- Destroy its buffer/image.
- Set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY.
Then, after vmaEndDefragmentationPass() the allocation will be freed.
Trait Implementations
sourceimpl Clone for VmaDefragmentationPassMoveInfo
impl Clone for VmaDefragmentationPassMoveInfo
sourcefn clone(&self) -> VmaDefragmentationPassMoveInfo
fn clone(&self) -> VmaDefragmentationPassMoveInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for VmaDefragmentationPassMoveInfo
Auto Trait Implementations
impl RefUnwindSafe for VmaDefragmentationPassMoveInfo
impl !Send for VmaDefragmentationPassMoveInfo
impl !Sync for VmaDefragmentationPassMoveInfo
impl Unpin for VmaDefragmentationPassMoveInfo
impl UnwindSafe for VmaDefragmentationPassMoveInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more