Navigation
API > API/Runtime > API/Runtime/RHI > API/Runtime/RHI/FGPUDefragAllocator
References
| Module | RHI |
| Header | /Engine/Source/Runtime/RHI/Public/GPUDefragAllocator.h |
| Include | #include "GPUDefragAllocator.h" |
Syntax
class FMemoryChunk
Remarks
Contains information of a single allocation or free block.
Variables
| Type | Name | Description | |
|---|---|---|---|
| uint8 * | Base | Base of chunk. | |
| FGPUDefragAllocator & | BestFitAllocator | Allows access to FBestFitAllocator members such as FirstChunk, FirstFreeChunk and LastChunk. | |
| bool | bIsAvailable | Whether the chunk is available. | |
| bool | bTail | ||
| uint16 | DefragCounter | Defrag counter. If this chunk failed to defrag, it won't try it again until the counter is 0. | |
| int32 | LockCount | Whether the chunk has been locked. | |
| FMemoryChunk * | NextChunk | Pointer to next chunk. | |
| FMemoryChunk * | NextFreeChunk | Pointer to next free chunk. | |
| int64 | OrigSize | ||
| FMemoryChunk * | PreviousChunk | Pointer to previous chunk. | |
| FMemoryChunk * | PreviousFreeChunk | Pointer to previous free chunk. | |
| int64 | Size | Size of chunk. | |
| TStatId | Stat | Stat associated with this allocation | |
| uint32 | SyncIndex | SyncIndex that must be exceeded before accessing the data within this chunk. | |
| int64 | SyncSize | Number of uint8s covered by the SyncIndex (starting from the beginning of the chunk). | |
| void * | UserPayload | User payload, e.g. platform-specific texture Pointer. Only chunks with payload can be relocated. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMemoryChunk
(
uint8* InBase, |
Private constructor. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Unlinks/ removes the chunk from the linked lists it belongs to. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint64 | Compare
(
const FMemoryChunk* A, |
Comparison function for Sort(), etc, based on increasing base address. | |
| int64 | Returns the number of uint8s that can be allocated from this chunk. | ||
| int64 | GetFinalSize () |
Returns the current size (in uint8s), or the final size if it has a reallocating request. | |
| uint32 | GetSyncIndex () |
Returns the relocation sync index. | |
| bool | IsLocked () |
||
| bool | IsRelocating () |
Returns true if the Chunk is being asynchronously relocated due to reallocation or defrag. | |
| void | Link
(
FMemoryChunk*& ChunkToInsertAfter |
Inserts this chunk after the passed in one. | |
| void | LinkFree
(
FMemoryChunk* FirstFreeChunkToSearch |
Inserts this chunk at the head of the free chunk list. | |
| void | SetSyncIndex
(
uint32 InSyncIndex, |
Sets the relocation sync index. | |
| void | Unlink () |
Removes itself for linked list. | |
| void | UnlinkFree () |
Removes itself for linked "free" list. Maint32ains the free-list order. |