r.RDG.ParallelExecute.PassMax
r.RDG.ParallelExecute.PassMax
#Overview
name: r.RDG.ParallelExecute.PassMax
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The maximum span of contiguous passes eligible for parallel execution for the span to be offloaded to a task.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RDG.ParallelExecute.PassMax is to control the maximum span of contiguous passes eligible for parallel execution in the Render Dependency Graph (RDG) system of Unreal Engine 5. This setting is part of the rendering system, specifically the RDG subsystem, which is responsible for managing the execution of render passes.
The Unreal Engine subsystem that relies on this setting variable is the RenderCore module, particularly the RDG (Render Dependency Graph) system. This can be seen from the file locations where the variable is referenced, all within the RenderCore directory.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 32 and can be modified at runtime using the console command “r.RDG.ParallelExecute.PassMax”.
This variable interacts closely with its associated variable GRDGParallelExecutePassMax. They share the same value, with r.RDG.ParallelExecute.PassMax being the console-accessible name and GRDGParallelExecutePassMax being the C++ variable used in the code.
Developers must be aware that this variable affects the parallelization of render passes. It determines the threshold at which a span of contiguous passes is considered large enough to be offloaded to a separate task for parallel execution. Setting this value too low might result in unnecessary task creation overhead, while setting it too high might reduce parallelism opportunities.
Best practices when using this variable include:
- Monitoring performance metrics when adjusting this value to find the optimal setting for your specific use case.
- Considering the complexity and duration of your render passes when tuning this value.
- Testing thoroughly across different hardware configurations, as the optimal value may vary depending on the available CPU cores and GPU capabilities.
Regarding the associated variable GRDGParallelExecutePassMax:
The purpose of GRDGParallelExecutePassMax is to provide a C++ accessible version of the r.RDG.ParallelExecute.PassMax setting. It’s used directly in the code to make decisions about parallel execution of render passes.
This variable is used in the RenderCore module, specifically in the RDG system implementation.
Its value is set by the console variable system, mirroring the value of r.RDG.ParallelExecute.PassMax.
GRDGParallelExecutePassMax interacts directly with the console variable r.RDG.ParallelExecute.PassMax, always maintaining the same value.
Developers should be aware that modifying GRDGParallelExecutePassMax directly in code is not recommended, as it may be overwritten by the console variable system. Instead, they should use the r.RDG.ParallelExecute.PassMax console command to change this value.
Best practices for using GRDGParallelExecutePassMax include:
- Reading its value rather than writing to it directly in code.
- Using it in conjunction with other RDG-related variables to fine-tune rendering performance.
- Considering its value when implementing new render passes or optimizing existing ones, especially in terms of how they might be grouped for parallel execution.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:382
Scope: file
Source code excerpt:
int32 GRDGParallelExecutePassMax = 32;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMax(
TEXT("r.RDG.ParallelExecute.PassMax"), GRDGParallelExecutePassMax,
TEXT("The maximum span of contiguous passes eligible for parallel execution for the span to be offloaded to a task."),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecuteStress = 0;
FAutoConsoleVariableRef CVarRDGDebugParallelExecute(
TEXT("r.RDG.ParallelExecuteStress"),
#Associated Variable and Callsites
This variable is associated with another variable named GRDGParallelExecutePassMax
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphBuilder.cpp:2636
Scope (from outer to inner):
file
function void FRDGBuilder::SetupParallelExecute
Source code excerpt:
}
if (ParallelPassCandidatesWorkload >= (uint32)GRDGParallelExecutePassMax)
{
FlushParallelPassCandidates();
}
}
ParallelPassCandidates.Emplace(EpiloguePass);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:380
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
int32 GRDGParallelExecutePassMax = 32;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMax(
TEXT("r.RDG.ParallelExecute.PassMax"), GRDGParallelExecutePassMax,
TEXT("The maximum span of contiguous passes eligible for parallel execution for the span to be offloaded to a task."),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecuteStress = 0;
FAutoConsoleVariableRef CVarRDGDebugParallelExecute(
TEXT("r.RDG.ParallelExecuteStress"),
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:123
Scope: file
Source code excerpt:
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
extern int32 GRDGVerboseCSVStats;
#else