r.RDG.Debug.GraphFilter

r.RDG.Debug.GraphFilter

#Overview

name: r.RDG.Debug.GraphFilter

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.RDG.Debug.GraphFilter is to filter debug events to a specific render graph in Unreal Engine’s Render Dependency Graph (RDG) system. This setting variable is primarily used for debugging and profiling the rendering pipeline.

This setting variable is mainly used within the RenderCore module of Unreal Engine, specifically in the RenderGraphPrivate.cpp file. It’s part of the rendering system and is used to help developers debug render graphs.

The value of this variable is set through the console variable system (CVarRDGDebugGraphFilter). It can be set via the console, configuration files, or through command-line arguments using the “rdgdebuggraphfilter=” parameter.

This variable interacts closely with GRDGDebugGraphFilterName, which stores the processed filter string. The value is processed using the GetDebugFilterString function before being assigned to GRDGDebugGraphFilterName.

Developers should be aware that this variable is primarily for debugging purposes. It should be used carefully in production environments as it may impact performance when enabled. It’s best used during development and profiling stages.

Best practices for using this variable include:

  1. Use it temporarily for debugging specific render graphs.
  2. Reset it to ‘None’ when not needed to avoid unnecessary filtering.
  3. Combine it with other RDG debugging tools for comprehensive analysis.

Regarding the associated variable CVarRDGDebugGraphFilter:

The purpose of CVarRDGDebugGraphFilter is to provide a console-accessible way to set the r.RDG.Debug.GraphFilter value. It’s the actual console variable that stores the filter string.

This console variable is part of the RenderCore module and is used to interface with the engine’s console system.

The value of CVarRDGDebugGraphFilter is set through the console or programmatically using the Set method. It’s also initialized from command-line arguments if provided.

CVarRDGDebugGraphFilter interacts directly with r.RDG.Debug.GraphFilter and indirectly with GRDGDebugGraphFilterName through a lambda function that updates GRDGDebugGraphFilterName whenever the console variable changes.

Developers should be aware that changes to CVarRDGDebugGraphFilter will trigger an update to GRDGDebugGraphFilterName. This happens on the game thread, so there might be a slight delay before the change takes effect in the render thread.

Best practices for using CVarRDGDebugGraphFilter include:

  1. Use it for runtime debugging and profiling.
  2. Be cautious when changing it in shipping builds, as it may affect performance.
  3. Consider exposing it in debug UIs for easier manipulation during development.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:101

Scope: file

Source code excerpt:


TAutoConsoleVariable<FString> CVarRDGDebugGraphFilter(
	TEXT("r.RDG.Debug.GraphFilter"), TEXT(""),
	TEXT("Filters certain debug events to a specific graph. Set to 'None' to reset.\n"),
	ECVF_Default);

FString GRDGDebugGraphFilterName;

inline FString GetDebugFilterString(const FString& InputString)

#Associated Variable and Callsites

This variable is associated with another variable named CVarRDGDebugGraphFilter. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:100

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

TAutoConsoleVariable<FString> CVarRDGDebugGraphFilter(
	TEXT("r.RDG.Debug.GraphFilter"), TEXT(""),
	TEXT("Filters certain debug events to a specific graph. Set to 'None' to reset.\n"),
	ECVF_Default);

FString GRDGDebugGraphFilterName;

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:118

Scope (from outer to inner):

file
lambda-function

Source code excerpt:

FAutoConsoleVariableSink CVarRDGDebugGraphSink(FConsoleCommandDelegate::CreateLambda([]()
{
	GRDGDebugGraphFilterName = GetDebugFilterString(CVarRDGDebugGraphFilter.GetValueOnGameThread());
}));

inline bool IsDebugAllowed(const FString& FilterString, const TCHAR* Name)
{
	if (FilterString.IsEmpty())
	{

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:563

Scope (from outer to inner):

file
function     void InitRenderGraph

Source code excerpt:

	if (FParse::Value(FCommandLine::Get(), TEXT("rdgdebuggraphfilter="), GraphFilter))
	{
		CVarRDGDebugGraphFilter->Set(*GraphFilter);
	}

	FString PassFilter;
	if (FParse::Value(FCommandLine::Get(), TEXT("rdgdebugpassfilter="), PassFilter))
	{
		CVarRDGDebugPassFilter->Set(*PassFilter);