r.RDG.ParallelExecute
r.RDG.ParallelExecute
#Overview
name: r.RDG.ParallelExecute
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to enable parallel execution of passes when supported. 0: off; 1: on (default)
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RDG.ParallelExecute is to control whether parallel execution of passes is enabled in the Render Dependency Graph (RDG) system of Unreal Engine 5. This setting is primarily used for the rendering system, specifically for optimizing the execution of render passes.
The Unreal Engine subsystem that relies on this setting variable is the Render Dependency Graph (RDG) system, which is part of the rendering pipeline. This can be inferred from the file location (RenderGraphPrivate.cpp) and the variable name itself.
The value of this variable is set through a console variable (CVarRDGParallelExecute) and can be modified at runtime. It’s also initialized during the engine startup in the InitRenderGraph function, where it can be set via command-line arguments.
The associated variable GRDGParallelExecute interacts directly with r.RDG.ParallelExecute. They share the same value, with GRDGParallelExecute being the actual integer variable used in the code to check if parallel execution is enabled.
Developers must be aware of the following when using this variable:
- It’s a boolean-like integer (0 for off, 1 for on).
- The default value is 1 (enabled).
- Changing this value can affect rendering performance and behavior.
- It’s part of a larger system of RDG-related variables that control various aspects of the rendering pipeline.
Best practices when using this variable include:
- Only disable it if there are specific issues with parallel execution of render passes.
- Consider the impact on performance when modifying this setting.
- Test thoroughly after changing this value, as it can affect the entire rendering pipeline.
- Use in conjunction with other RDG-related settings for fine-tuning rendering performance.
Regarding the associated variable GRDGParallelExecute:
- Its purpose is to provide a direct, code-accessible way to check if parallel execution is enabled.
- It’s used in various parts of the RDG system to conditionally enable parallel execution features.
- The value is set both through the console variable and potentially through command-line arguments.
- It interacts with several other RDG-related variables and systems, as seen in the IsParallelExecuteEnabled function.
- Developers should be aware that this variable is used in conditional checks throughout the RDG system, so changing its value can have wide-ranging effects.
- Best practices include using this variable for conditional logic in render pass implementations and being aware of its current state when debugging rendering issues.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:353
Scope: file
Source code excerpt:
int32 GRDGParallelExecute = 1;
FAutoConsoleVariableRef CVarRDGParallelExecute(
TEXT("r.RDG.ParallelExecute"), GRDGParallelExecute,
TEXT("Whether to enable parallel execution of passes when supported.")
TEXT(" 0: off;")
TEXT(" 1: on (default)"),
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* Variable)
{
if (Variable->GetInt())
#Associated Variable and Callsites
This variable is associated with another variable named GRDGParallelExecute
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:351
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
int32 GRDGParallelExecute = 1;
FAutoConsoleVariableRef CVarRDGParallelExecute(
TEXT("r.RDG.ParallelExecute"), GRDGParallelExecute,
TEXT("Whether to enable parallel execution of passes when supported.")
TEXT(" 0: off;")
TEXT(" 1: on (default)"),
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* Variable)
{
if (Variable->GetInt())
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:601
Scope (from outer to inner):
file
function void InitRenderGraph
Source code excerpt:
if (FParse::Value(FCommandLine::Get(), TEXT("rdgparallelexecute="), ParallelExecuteValue))
{
GRDGParallelExecute = ParallelExecuteValue;
}
#endif
int32 MergeRenderPassesValue = 0;
if (FParse::Value(FCommandLine::Get(), TEXT("rdgmergerenderpasses="), MergeRenderPassesValue))
{
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:628
Scope (from outer to inner):
file
function bool IsParallelExecuteEnabled
Source code excerpt:
bool IsParallelExecuteEnabled()
{
return GRDGParallelExecute > 0
&& !GRHICommandList.Bypass()
&& !IsImmediateMode()
&& !GRDGDebug
&& !GRDGDebugFlushGPU
&& !GRDGTransitionLog
&& !IsMobilePlatform(GMaxRHIShaderPlatform)
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:121
Scope: file
Source code excerpt:
extern int32 GRDGParallelDestruction;
extern int32 GRDGParallelSetup;
extern int32 GRDGParallelExecute;
extern int32 GRDGParallelExecutePassMin;
extern int32 GRDGParallelExecutePassMax;
#else
const int32 GRDGParallelDestruction = 0;
const int32 GRDGParallelSetup = 0;
const int32 GRDGParallelExecute = 0;
const int32 GRDGParallelExecutePassMin = 0;
const int32 GRDGParallelExecutePassMax = 0;
#endif
#if CSV_PROFILER