![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GPUSortManager.h>
Inheritance diagram for FGPUSortManager:Classes | |
| struct | FAllocationInfo |
| struct | FKeyGenInfo |
Public Attributes | |
| FPostPreRenderEvent | PostPreRenderEvent |
| FPostPreRenderEvent | PostPostRenderEvent |
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"
| FGPUSortManager::FGPUSortManager | ( | ERHIFeatureLevel::Type | InFeatureLevel | ) |
Creates the sort manager, this is when the settings are configured.
| FGPUSortManager::~FGPUSortManager | ( | ) |
| bool FGPUSortManager::AddTask | ( | FRHICommandListBase & | RHICmdList, |
| FAllocationInfo & | OutInfo, | ||
| int32 | ValueCount, | ||
| EGPUSortFlags | TaskFlags | ||
| ) |
Add a GPU sort task to process this frame. Tasks are expected to be created before OnPreRender() gets called.
| OutInfo | - The details about the allocation bindings, if success. |
| IndexCount | - The number of values that need to be sorted by this task. |
| SortFlags | - The sort task requirements. |
Return true if the task was added to a batch, false otherwise, could be because GPU sorting is disabled.
| FGPUSortManager::DECLARE_EVENT_OneParam | ( | FGPUSortManager | , |
| FPostPostRenderEvent | , | ||
| FRHICommandListImmediate & | |||
| ) |
Event to register and receive post-postrender notification.
| FGPUSortManager::DECLARE_EVENT_OneParam | ( | FGPUSortManager | , |
| FPostPreRenderEvent | , | ||
| FRHICommandListImmediate & | |||
| ) |
Event to register and receive post-prerender notification.
| void FGPUSortManager::OnPostRenderOpaque | ( | class FRDGBuilder & | GraphBuilder | ) |
Callback that needs to be called in the rendering loop, after calls to FFXSystemInterface::PostRenderOpaque() are issued. Tasks with EGPUSortFlags::KeyGenAfterPostRenderOpaque get their client callbacks issued to set the initial keys and values. After this any sort task that hasn't been processed yet, in OnPreRender(), gets processed now.
| RHICmdList | - The command list to be used. |
| void FGPUSortManager::OnPreRender | ( | class FRDGBuilder & | GraphBuilder | ) |
Callback that needs to be called in the rendering loop, after calls to FFXSystemInterface::PreRender() are issued. At this point, no other GPU sort tasks are allowed to be created through AddTask() as the sort batches get finalized. At this point, any task with the EGPUSortFlags::SortAfterPreRender will possibly be done, unless it also had the EGPUSortFlags::SortAfterPostRenderOpaque flag. Tasks with EGPUSortFlags::KeyGenAfterPreRender get their client callbacks issued to set the initial keys and values.
| RHICmdList | - The command list to be used. |
| void FGPUSortManager::Register | ( | const FGPUSortKeyGenDelegate & | CallbackDelegate, |
| EGPUSortFlags | UsedFlags, | ||
| const FName & | InName | ||
| ) |
Register a client system into the sort manager. Client systems are systems that will call AddTask(). Those systems need to register a callback, the possible used flags for their tasks and a name. The callback is required because the initial content to perform GPU sorts is only configured long after AddTask() gets called in the rendering loop.
| CallbackDelegate | - The callback that will be used to set the initial keys and values for each batch elements. |
| UsedFlags | - The possibly used flags for each of the client system tasks, used to perform some optimizations. |
| InName | - A name defining this client system, used for GPU markers. |
| FPostPreRenderEvent FGPUSortManager::PostPostRenderEvent |
| FPostPreRenderEvent FGPUSortManager::PostPreRenderEvent |