Navigation
API > API/Runtime > API/Runtime/Engine
A manager that handles different GPU sort tasks. Each task has different constraints about when the data can be generated and when the sorted results need to be available. The usecase involes registering a sort task through AddTask() and then initializing the sort data through the KeyGen callback. The sort manager can be enabled or disabled through "fx.AllowGPUSorting"
| Name | FGPUSortManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/GPUSortManager.h |
| Include Path | #include "GPUSortManager.h" |
Syntax
class FGPUSortManager : public FRefCountedObject
Inheritance Hierarchy
- FRefCountedObject → FGPUSortManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGPUSortManager
(
ERHIFeatureLevel::Type InFeatureLevel |
Creates the sort manager, this is when the settings are configured. | GPUSortManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FGPUSortManager() |
GPUSortManager.h |
Classes
| Name | Remarks |
|---|---|
| FPostPostRenderEvent | Event to register and receive post-postrender notification. |
| FPostPreRenderEvent | Event to register and receive post-prerender notification. |
| FValueBuffer | A vertex buffer owning the final sorted values. |
Structs
| Name | Remarks |
|---|---|
| FAllocationInfo | Information about the bindings for a given sort task. |
| FCallbackInfo | Holds data relative to client systems of the GPU sort manager. |
| FDynamicValueBuffer | Encapsulates the idea of a growable FValueBuffer, that dynamically change in size depending on requirements. |
| FKeyGenInfo | A little helper to generate the batch element keys based on the number of elements in the batch and the sort precision. |
| FSettings | Different settings used to manage the buffer allocations. |
| FSortBatch | Defines a sort batch that regroups several sort tasks created by FGPUSortManager::AddTask(), becoming sort the batch elements. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FCallbackArray | TArray< FCallbackInfo > | GPUSortManager.h | |
| FDynamicValueBufferArray | TIndirectArray< FDynamicValueBuffer, TInlineAllocator< 4 > > | GPUSortManager.h | |
| FSortBatchArray | TArray< FSortBatch, TInlineAllocator< 4 > > | Expected that few will be enough, since we only need severals batches when ESortBatchProcessingOrder::KeyGenAfterPreRenderAndSortAfterPostRenderOpaque. | GPUSortManager.h |
| FValueBufferArray | TIndirectArray< FValueBuffer, TInlineAllocator< 4 > > | GPUSortManager.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| PostPostRenderEvent | FPostPreRenderEvent | GPUSortManager.h | ||
| PostPreRenderEvent | FPostPreRenderEvent | GPUSortManager.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Callbacks | FCallbackArray | The client system callbacks, see Register(). | GPUSortManager.h | |
| DynamicValueBufferPool | FDynamicValueBufferArray | A pool of buffer to hold the final sorted values for each batch. Reused between frames. | GPUSortManager.h | |
| FeatureLevel | ERHIFeatureLevel::Type | The current feature level, needed to access the global shader map. | GPUSortManager.h | |
| Settings | FSettings | Settings to handle the buffer reallocation strategy. | GPUSortManager.h | |
| SortBatches | FSortBatchArray | The different batches that will be used this frame, each one ending up being sorting work on the GPU. | GPUSortManager.h | |
| SortBuffersPool | TArray< FParticleSortBuffers *, TInlineAllocator< 2 > > | A pool of GPU sort buffers. The same sort GPU buffer can normally be used in several sort batches. | GPUSortManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddTask
(
FAllocationInfo& OutInfo, |
GPUSortManager.h | ||
bool AddTask
(
FRHICommandListBase& RHICmdList, |
Add a GPU sort task to process this frame. | GPUSortManager.h | |
void OnPostRenderOpaque
(
FRDGBuilder& GraphBuilder |
Callback that needs to be called in the rendering loop, after calls to FFXSystemInterface::PostRenderOpaque() are issued. | GPUSortManager.h | |
void OnPreRender
(
FRDGBuilder& GraphBuilder |
Callback that needs to be called in the rendering loop, after calls to FFXSystemInterface::PreRender() are issued. | GPUSortManager.h | |
void Register
(
const FGPUSortKeyGenDelegate& CallbackDelegate, |
Register a client system into the sort manager. | GPUSortManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static EGPUSortFlags CombineBatchFlags
(
EGPUSortFlags BatchFlags, |
Update a batch flags after adding a task into it. | GPUSortManager.h | |
static EGPUSortFlags GetBatchFlags
(
EGPUSortFlags TaskFlags |
Create the initial batch flags from a task flags. | GPUSortManager.h | |
static TCHAR const(&)[1] GetPrecisionString
(
EGPUSortFlags BatchFlags |
Convert the precision flags into a string, used for GPU markers. | GPUSortManager.h | |
static bool HasEither
(
EGPUSortFlags Flags, |
A helper to test that a flag has one and exactly one of A or B. | GPUSortManager.h | |
static bool TestBatchFlags
(
EGPUSortFlags BatchFlags, |
Test whether a batch flags are compatible with a given task. | GPUSortManager.h |