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