Navigation
API > API/Runtime > API/Runtime/RenderCore
Represents a command list of render commands that can be recorded on a thread and submitted. Recording is done using the FRecordScope which sets the command list in TLS, diverting any render commands enqueued via ENQUEUE_RENDER_COMMAND into the command list. Command lists can submit into other command lists as well as the main render command pipes. Command lists are useful for a couple reasons. First, the cost of queuing commands into command lists is very light when recording into command lists as there are no locks, at the cost of deferring submission of the work. Second, command lists can be submitted and recorded asynchronously from each other.
Command lists actually contain several sub-command lists, one for each render command pipe. At submission time the sub-command lists are submitted separately. It doesn't matter if commands are enqueued to a pipe, they all go into the same command list.
Command lists have two operations, Close and Submit. Call Close when recording is complete. Call Submit to patch the command list into a parent command list or the global render command pipes. Use FRenderCommandDispatcher::Submit to submit command lists.
Command lists support a fast-path with ERenderCommandListFlags::CloseOnSubmit. This fuses the Close / Submit operations but enables an optimization to skip empty lists at the end, which is helpful when managing a large number of command lists (see FParallelForContext for a concrete use case).
| Name | FRenderCommandList |
| Type | class |
| Header File | /Engine/Source/Runtime/RenderCore/Public/RenderingThread.h |
| Include Path | #include "RenderingThread.h" |
Syntax
class FRenderCommandList : public TConcurrentLinearObject< FRenderCommandList >
Inheritance Hierarchy
- TConcurrentLinearObject → FRenderCommandList
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FRenderCommandList
(
ERenderCommandListFlags InFlags, |
RenderingThread.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FRenderCommandList() |
RenderingThread.h |
Classes
| Name | Remarks |
|---|---|
| FFlushScope | A scope to unbind and flush the contents of the currently recording command list if there is one. |
| FParallelForContext | A task context for use with parallel for that allocates a command list for each task thread. |
| FRecordScope | A scope to bind a command list for recording on the current thread. |
Enums
Public
| Name | Remarks |
|---|---|
| EStopRecordingAction |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EPageSize | FMemStackBase::EPageSize | RenderingThread.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InstanceTLS | thread_local FRenderCommandList * | RenderingThread.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Head | FRenderCommandList * | RenderingThread.h | ||
| Tail | FRenderCommandList * | RenderingThread.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Allocator | FMemStackBase | RenderingThread.h | ||
| bInitialized | uint8 | RenderingThread.h | ||
| bRecording | uint8 | RenderingThread.h | ||
| bSubmitted | uint8 | RenderingThread.h | ||
| Children | FRenderCommandList | RenderingThread.h | ||
| CommandLists | TArray< UE::RenderCommandPipe::FCommandList, FConcurrentLinearArrayAllocator > | RenderingThread.h | ||
| DispatchTaskEvent | TOptional< UE::Tasks::FTaskEvent > | RenderingThread.h | ||
| Flags | const ERenderCommandListFlags | RenderingThread.h | ||
| NextSibling | FRenderCommandList * | RenderingThread.h | ||
| NumPipeRefs | std::atomic_int32_t | RenderingThread.h | ||
| NumRecordScopeRefs | uint8 | RenderingThread.h | ||
| Parent | FRenderCommandList * | RenderingThread.h | ||
| PipeEnqueueFailedBits | FRenderCommandPipeBitArray | RenderingThread.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Close() |
Call when the command list recording is finished. | RenderingThread.h | |
UE::Tasks::FTask GetDispatchTask() |
RenderingThread.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FRenderCommandList * Create
(
ERenderCommandListFlags InFlags, |
RenderingThread.h | ||
static FRenderCommandList * GetInstanceTLS() |
RenderingThread.h | ||
static FRenderCommandList * SetInstanceTLS
(
FRenderCommandList* CommandList |
RenderingThread.h |