Parameters for incremental defragmentation steps. More...
#include <D3D12MemAlloc.h>
Public Attributes | |
UINT32 | MoveCount |
Number of elements in the pMoves array. | |
DEFRAGMENTATION_MOVE * | pMoves |
Array of moves to be performed by the user in the current defragmentation pass. | |
Parameters for incremental defragmentation steps.
To be used with function DefragmentationContext::BeginPass().
DEFRAGMENTATION_MOVE* D3D12MA::DEFRAGMENTATION_PASS_MOVE_INFO::pMoves |
Array of moves to be performed by the user in the current defragmentation pass.
Pointer to an array of MoveCount
elements, owned by D3D12MA, created in DefragmentationContext::BeginPass(), destroyed in DefragmentationContext::EndPass().
For each element, you should:
pMoves[i].pDstTmpAllocation->GetHeap()
+ pMoves[i].pDstTmpAllocation->GetOffset()
.pMoves[i].pDstTmpAllocation
by using Allocation::SetResource(). It will later replace old resource from pMoves[i].pSrcAllocation
.pMoves[i].pSrcAllocation
e.g. using D3D12GraphicsCommandList::CopyResource
.Only then you can finish defragmentation pass by calling DefragmentationContext::EndPass(). After this call, the allocation will point to the new place in memory.
Alternatively, if you cannot move specific allocation, you can set DEFRAGMENTATION_MOVE::Operation to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_IGNORE.
Alternatively, if you decide you want to completely remove the allocation, set DEFRAGMENTATION_MOVE::Operation to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_DESTROY. Then, after DefragmentationContext::EndPass() the allocation will be released.