r.RDG.ParallelExecute.PassMin
r.RDG.ParallelExecute.PassMin
#Overview
name: r.RDG.ParallelExecute.PassMin
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The minimum 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.PassMin is to set the minimum number of contiguous passes in the Render Dependency Graph (RDG) that are eligible for parallel execution. This setting is part of Unreal Engine’s rendering system, specifically the RDG subsystem, which is responsible for managing and optimizing the rendering pipeline.
This setting variable is primarily used in the RenderCore module of Unreal Engine, as evidenced by its references in RenderGraphPrivate.cpp and RenderGraphBuilder.cpp files.
The value of this variable is set through the console variable system, using an FAutoConsoleVariableRef named CVarRDGParallelExecutePassMin. It’s initialized with a default value of 1.
The associated variable GRDGParallelExecutePassMin directly interacts with r.RDG.ParallelExecute.PassMin. They share the same value, and GRDGParallelExecutePassMin is used in the actual C++ code to control the behavior.
Developers must be aware that this variable affects the parallelization of render passes. Setting it too low might result in unnecessary overhead from parallelization of small sets of passes, while setting it too high might prevent efficient use of parallel execution.
Best practices when using this variable include:
- Adjusting it based on the complexity of your rendering pipeline.
- Balancing it with r.RDG.ParallelExecute.PassMax for optimal performance.
- Profiling the rendering performance with different values to find the sweet spot for your specific use case.
Regarding the associated variable GRDGParallelExecutePassMin:
The purpose of GRDGParallelExecutePassMin is to provide a C++ accessible version of the r.RDG.ParallelExecute.PassMin setting. It’s used directly in the rendering code to determine when to parallelize a set of render passes.
This variable is used in the RenderCore module, specifically in the FRDGBuilder::SetupParallelExecute function.
Its value is set by the console variable system, mirroring the value of r.RDG.ParallelExecute.PassMin.
GRDGParallelExecutePassMin interacts directly with the ParallelPassCandidateCount in the code to determine if a set of passes should be executed in parallel.
Developers should be aware that modifying GRDGParallelExecutePassMin directly in code is not recommended, as it would bypass the console variable system and potentially create inconsistencies.
The best practice is to use the console variable r.RDG.ParallelExecute.PassMin to adjust this value, rather than modifying GRDGParallelExecutePassMin directly in code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:376
Scope: file
Source code excerpt:
int32 GRDGParallelExecutePassMin = 1;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMin(
TEXT("r.RDG.ParallelExecute.PassMin"), GRDGParallelExecutePassMin,
TEXT("The minimum span of contiguous passes eligible for parallel execution for the span to be offloaded to a task."),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecutePassMax = 32;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMax(
TEXT("r.RDG.ParallelExecute.PassMax"), GRDGParallelExecutePassMax,
#Associated Variable and Callsites
This variable is associated with another variable named GRDGParallelExecutePassMin
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphBuilder.cpp:2573
Scope (from outer to inner):
file
function void FRDGBuilder::SetupParallelExecute
lambda-function
Source code excerpt:
const int32 ParallelPassCandidateCount = PassEndIndex - PassBeginIndex;
if (ParallelPassCandidateCount >= GRDGParallelExecutePassMin)
{
FRDGPass* PassBegin = ParallelPassCandidates[PassBeginIndex];
PassBegin->bParallelExecuteBegin = 1;
PassBegin->ParallelPassSetIndex = ParallelExecute.ParallelPassSets.Num();
FRDGPass* PassEnd = ParallelPassCandidates[PassEndIndex - 1];
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:374
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
int32 GRDGParallelExecutePassMin = 1;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMin(
TEXT("r.RDG.ParallelExecute.PassMin"), GRDGParallelExecutePassMin,
TEXT("The minimum span of contiguous passes eligible for parallel execution for the span to be offloaded to a task."),
ECVF_RenderThreadSafe);
int32 GRDGParallelExecutePassMax = 32;
FAutoConsoleVariableRef CVarRDGParallelExecutePassMax(
TEXT("r.RDG.ParallelExecute.PassMax"), GRDGParallelExecutePassMax,
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:122
Scope: file
Source code excerpt:
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
extern int32 GRDGVerboseCSVStats;