r.RDG.ParallelSetup
r.RDG.ParallelSetup
#Overview
name: r.RDG.ParallelSetup
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
RDG will setup passes in parallel when prompted by calls to FRDGBuilder::FlushSetupQueue. 0: pass setup is done synchronously in AddPass; 1: pass setup is done asynchronously (default);
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RDG.ParallelSetup is to control the parallel setup of passes in the Render Dependency Graph (RDG) system of Unreal Engine 5. It determines whether pass setup is done synchronously or asynchronously when prompted by calls to FRDGBuilder::FlushSetupQueue.
This setting variable is primarily used in the rendering system, specifically within the Render Dependency Graph (RDG) subsystem. The RDG is a crucial part of Unreal Engine’s rendering pipeline, responsible for managing the dependencies and execution order of rendering passes.
The value of this variable is set through the console variable system. It can be modified at runtime using console commands or through configuration files. The default value is 1, which enables asynchronous pass setup.
The associated variable GRDGParallelSetup directly interacts with r.RDG.ParallelSetup. They share the same value, with GRDGParallelSetup being the actual integer variable used in the C++ code.
Developers should be aware of the following when using this variable:
- Setting it to 0 will force synchronous pass setup in AddPass, which may impact performance.
- The parallel setup is only enabled under certain conditions, as checked in the IsParallelSetupEnabled() function.
- It can be overridden via command line arguments using “rdgparallelsetup=”.
Best practices for using this variable include:
- Generally, leave it at the default value (1) for optimal performance.
- If debugging RDG-related issues, setting it to 0 might help isolate problems by simplifying the execution flow.
- Be cautious when modifying this value in production builds, as it can significantly impact rendering performance.
Regarding the associated variable GRDGParallelSetup:
- It’s the actual integer variable used throughout the C++ code to control parallel setup behavior.
- It’s initialized with a value of 1, matching the default console variable setting.
- It’s used in conditions to determine whether parallel setup should be enabled, such as in the IsParallelSetupEnabled() function.
- It can be modified programmatically, allowing for dynamic control of parallel setup behavior based on runtime conditions.
- Developers should treat GRDGParallelSetup as read-only in most cases, relying on the console variable system to modify its value for consistency and proper engine behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:345
Scope: file
Source code excerpt:
int32 GRDGParallelSetup = 1;
FAutoConsoleVariableRef CVarRDGParallelSetup(
TEXT("r.RDG.ParallelSetup"), GRDGParallelSetup,
TEXT("RDG will setup passes in parallel when prompted by calls to FRDGBuilder::FlushSetupQueue.")
TEXT(" 0: pass setup is done synchronously in AddPass;")
TEXT(" 1: pass setup is done asynchronously (default);"),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecute = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GRDGParallelSetup
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:343
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
int32 GRDGParallelSetup = 1;
FAutoConsoleVariableRef CVarRDGParallelSetup(
TEXT("r.RDG.ParallelSetup"), GRDGParallelSetup,
TEXT("RDG will setup passes in parallel when prompted by calls to FRDGBuilder::FlushSetupQueue.")
TEXT(" 0: pass setup is done synchronously in AddPass;")
TEXT(" 1: pass setup is done asynchronously (default);"),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecute = 1;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:595
Scope (from outer to inner):
file
function void InitRenderGraph
Source code excerpt:
if (FParse::Value(FCommandLine::Get(), TEXT("rdgparallelsetup="), ParallelSetupValue))
{
GRDGParallelSetup = ParallelSetupValue;
}
int32 ParallelExecuteValue = 0;
if (FParse::Value(FCommandLine::Get(), TEXT("rdgparallelexecute="), ParallelExecuteValue))
{
GRDGParallelExecute = ParallelExecuteValue;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:648
Scope (from outer to inner):
file
function bool IsParallelSetupEnabled
Source code excerpt:
bool IsParallelSetupEnabled()
{
return GRDGParallelSetup > 0
&& !GRHICommandList.Bypass()
&& !IsImmediateMode()
&& !GRDGDebug
&& !GRDGTransitionLog
&& !IsMobilePlatform(GMaxRHIShaderPlatform)
&& !IsOpenGLPlatform(GMaxRHIShaderPlatform)
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:120
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