Direct3D 12 Memory Allocator
|
Represents defragmentation process in progress. More...
#include <D3D12MemAlloc.h>
Public Member Functions | |
HRESULT | BeginPass (DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo) |
Starts single defragmentation pass. | |
HRESULT | EndPass (DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo) |
Ends single defragmentation pass. | |
void | GetStats (DEFRAGMENTATION_STATS *pStats) |
Returns statistics of the defragmentation performed so far. | |
Represents defragmentation process in progress.
You can create this object using Allocator::BeginDefragmentation (for default pools) or Pool::BeginDefragmentation (for a custom pool).
HRESULT D3D12MA::DefragmentationContext::BeginPass | ( | DEFRAGMENTATION_PASS_MOVE_INFO * | pPassInfo | ) |
Starts single defragmentation pass.
[out] | pPassInfo | Computed informations for current pass. |
S_OK
if no more moves are possible. Then you can omit call to DefragmentationContext::EndPass() and simply end whole defragmentation.S_FALSE
if there are pending moves returned in pPassInfo
. You need to perform them, call DefragmentationContext::EndPass(), and then preferably try another pass with DefragmentationContext::BeginPass(). HRESULT D3D12MA::DefragmentationContext::EndPass | ( | DEFRAGMENTATION_PASS_MOVE_INFO * | pPassInfo | ) |
Ends single defragmentation pass.
pPassInfo | Computed informations for current pass filled by DefragmentationContext::BeginPass() and possibly modified by you. |
S_OK
if no more moves are possible or S_FALSE
if more defragmentations are possible.Ends incremental defragmentation pass and commits all defragmentation moves from pPassInfo
. After this call:
pPassInfo[i].pSrcAllocation
that had pPassInfo[i].Operation ==
DEFRAGMENTATION_MOVE_OPERATION_COPY (which is the default) will be pointing to the new destination place.pPassInfo[i].pSrcAllocation
that had pPassInfo[i].operation ==
DEFRAGMENTATION_MOVE_OPERATION_DESTROY will be released.If no more moves are possible you can end whole defragmentation.
void D3D12MA::DefragmentationContext::GetStats | ( | DEFRAGMENTATION_STATS * | pStats | ) |
Returns statistics of the defragmentation performed so far.