Open 3D Engine Atom Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
D3D12MA::DefragmentationContext Class Reference

Represents defragmentation process in progress. More...

#include <D3D12MemAlloc.h>

Inherits IUnknownImpl.

Public Member Functions

HRESULT BeginPass (DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo)
 Starts single defragmentation pass. More...
 
HRESULT EndPass (DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo)
 Ends single defragmentation pass. More...
 
void GetStats (DEFRAGMENTATION_STATS *pStats)
 Returns statistics of the defragmentation performed so far.
 

Protected Member Functions

void ReleaseThis () override
 

Friends

class Pool
 
class Allocator
 
template<typename T >
void D3D12MA_DELETE (const ALLOCATION_CALLBACKS &, T *)
 

Detailed Description

Represents defragmentation process in progress.

You can create this object using Allocator::BeginDefragmentation (for default pools) or Pool::BeginDefragmentation (for a custom pool).

Member Function Documentation

◆ BeginPass()

HRESULT D3D12MA::DefragmentationContext::BeginPass ( DEFRAGMENTATION_PASS_MOVE_INFO pPassInfo)

Starts single defragmentation pass.

Parameters
[out]pPassInfoComputed informations for current pass.
Returns

◆ EndPass()

HRESULT D3D12MA::DefragmentationContext::EndPass ( DEFRAGMENTATION_PASS_MOVE_INFO pPassInfo)

Ends single defragmentation pass.

Parameters
pPassInfoComputed informations for current pass filled by DefragmentationContext::BeginPass() and possibly modified by you.
Returns
Returns 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:

  • Allocation at pPassInfo[i].pSrcAllocation that had pPassInfo[i].Operation == #DEFRAGMENTATION_MOVE_OPERATION_COPY (which is the default) will be pointing to the new destination place.
  • Allocation at 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.


The documentation for this class was generated from the following file: