r.RDG.ParallelSetup

r.RDG.ParallelSetup

#Overview

name: r.RDG.ParallelSetup

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.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:

  1. Setting it to 0 will force synchronous pass setup in AddPass, which may impact performance.
  2. The parallel setup is only enabled under certain conditions, as checked in the IsParallelSetupEnabled() function.
  3. It can be overridden via command line arguments using “rdgparallelsetup=”.

Best practices for using this variable include:

  1. Generally, leave it at the default value (1) for optimal performance.
  2. If debugging RDG-related issues, setting it to 0 might help isolate problems by simplifying the execution flow.
  3. Be cautious when modifying this value in production builds, as it can significantly impact rendering performance.

Regarding the associated variable GRDGParallelSetup:

#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