Navigation
API > API/Runtime > API/Runtime/RenderCore > API/Runtime/RenderCore/FRenderCommandList
A task context for use with parallel for that allocates a command list for each task thread.
Example Usage:
FRenderCommandList* ParentCommandList = FRenderCommandList::Create();
UE::Tasks::Launch(UE_SOURCE_LOCATION, [ParentCommandList] { / Closes recording of the command list on completion of the scope. FRenderCommandList::FRecordScope RecordScope(ParentCommandList, FRenderCommandList::EStopRecordingAction::Close);
/ Constructs a parallel for context with the command list as the root. FRenderCommandList::FParallelForContext ParallelForContext(ParentCommandList, NumContexts);
/ Issue a parallel with a command list per thread. ParallelForWithExistingTaskContext(TEXT("ParallelFor"), ParallelForContext.GetCommandLists(), ..., [] (FRenderCommandList* InRenderCommandList) { FRenderCommandList::FRecordScope RecordScope(InRenderCommandList);
/ Commands are recorded into InRenderCommandList. }); });
ENQUEUE_RENDER_COMMAND(... [] { ... }); // Command A
/ Submit the command list at any time. All included render commands are patched between commands A and C. ParentCommandList->Submit();
ENQUEUE_RENDER_COMMAND(... [] { ... }); // Command C
| Name | FParallelForContext |
| Type | class |
| Header File | /Engine/Source/Runtime/RenderCore/Public/RenderingThread.h |
| Include Path | #include "RenderingThread.h" |
Syntax
class FParallelForContext
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FParallelForContext
(
const FParallelForContext& |
RenderingThread.h | ||
FParallelForContext
(
FRenderCommandList* InRootCommandList, |
RenderingThread.h | ||
FParallelForContext
(
FRenderCommandList* InRootCommandList, |
RenderingThread.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FParallelForContext() |
RenderingThread.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bSubmitRootCommandList | bool | RenderingThread.h | ||
| RootCommandList | FRenderCommandList * | RenderingThread.h | ||
| TaskCommandLists | TArray< FRenderCommandList *, FConcurrentLinearArrayAllocator > | RenderingThread.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TArrayView< FRenderCommandList * > GetCommandLists() |
RenderingThread.h | ||
FRenderCommandList * GetRootCommandList() |
RenderingThread.h | ||
void Submit() |
RenderingThread.h |