r.RDG.Debug.PassFilter

r.RDG.Debug.PassFilter

#Overview

name: r.RDG.Debug.PassFilter

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.RDG.Debug.PassFilter is to filter debug events for specific passes in the Render Dependency Graph (RDG) system of Unreal Engine 5. This setting variable is primarily used for debugging and profiling the rendering pipeline.

This setting variable is relied upon by the Render Core module, specifically within the RDG system. The RDG is a crucial part of Unreal Engine’s rendering architecture, responsible for managing dependencies between render passes and optimizing GPU workload.

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

The associated variable CVarRDGDebugPassFilter interacts directly with r.RDG.Debug.PassFilter. It’s an auto console variable that stores the actual string value of the pass filter. The global variable GRDGDebugPassFilterName is updated based on the value of CVarRDGDebugPassFilter.

Developers must be aware that this variable affects the debug output of the RDG system. When set, it will filter the debug events to only show information for the specified passes. This can be extremely useful when trying to debug or profile specific parts of the rendering pipeline, but it may also hide important information if not used carefully.

Best practices when using this variable include:

  1. Use it temporarily for debugging specific issues or optimizing particular render passes.
  2. Remember to reset it to ‘None’ after debugging to ensure all debug information is visible.
  3. Combine it with other RDG debug tools for comprehensive analysis.
  4. Be cautious when using it in production builds, as it may impact performance.

Regarding the associated variable CVarRDGDebugPassFilter:

The purpose of CVarRDGDebugPassFilter is to provide a console-accessible interface for the r.RDG.Debug.PassFilter setting. It allows for runtime modification of the pass filter through the console system.

This variable is part of the Render Core module and is specifically used within the RDG system.

The value of CVarRDGDebugPassFilter is set through the console variable system, either via console commands or configuration files. It’s also updated when the r.RDG.Debug.PassFilter is set through command-line arguments.

CVarRDGDebugPassFilter interacts directly with GRDGDebugPassFilterName through a console variable sink. When CVarRDGDebugPassFilter is modified, GRDGDebugPassFilterName is updated accordingly.

Developers should be aware that changes to CVarRDGDebugPassFilter will immediately affect the RDG debug output. It’s a powerful tool for runtime debugging but should be used judiciously.

Best practices for CVarRDGDebugPassFilter include:

  1. Use it for quick, iterative debugging during development.
  2. Be mindful of its performance impact in non-development builds.
  3. Consider creating preset values for commonly debugged passes to speed up the debugging process.
  4. Always verify that it’s set to the desired value before analyzing debug output.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


TAutoConsoleVariable<FString> CVarRDGDebugPassFilter(
	TEXT("r.RDG.Debug.PassFilter"), TEXT(""),
	TEXT("Filters certain debug events to specific passes. Set to 'None' to reset.\n"),
	ECVF_Default);

FString GRDGDebugPassFilterName;

FAutoConsoleVariableSink CVarRDGDebugPassSink(FConsoleCommandDelegate::CreateLambda([]()

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

}

TAutoConsoleVariable<FString> CVarRDGDebugPassFilter(
	TEXT("r.RDG.Debug.PassFilter"), TEXT(""),
	TEXT("Filters certain debug events to specific passes. Set to 'None' to reset.\n"),
	ECVF_Default);

FString GRDGDebugPassFilterName;

FAutoConsoleVariableSink CVarRDGDebugPassSink(FConsoleCommandDelegate::CreateLambda([]()
{
	GRDGDebugPassFilterName = GetDebugFilterString(CVarRDGDebugPassFilter.GetValueOnGameThread());
}));

bool IsDebugAllowedForPass(const TCHAR* PassName)
{
	return IsDebugAllowed(GRDGDebugPassFilterName, PassName);
}

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

Scope (from outer to inner):

file
function     void InitRenderGraph

Source code excerpt:

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

	FString ResourceFilter;
	if (FParse::Value(FCommandLine::Get(), TEXT("rdgdebugresourcefilter="), ResourceFilter))
	{
		CVarRDGDebugResourceFilter->Set(*ResourceFilter);