r.RDG.ParallelExecute

r.RDG.ParallelExecute

#Overview

name: r.RDG.ParallelExecute

This variable is created as a Console Variable (cvar).

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:

  1. It’s a boolean-like integer (0 for off, 1 for on).
  2. The default value is 1 (enabled).
  3. Changing this value can affect rendering performance and behavior.
  4. 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:

  1. Only disable it if there are specific issues with parallel execution of render passes.
  2. Consider the impact on performance when modifying this setting.
  3. Test thoroughly after changing this value, as it can affect the entire rendering pipeline.
  4. Use in conjunction with other RDG-related settings for fine-tuning rendering performance.

Regarding the associated variable GRDGParallelExecute:

#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