r.RDG.Debug.ResourceFilter

r.RDG.Debug.ResourceFilter

#Overview

name: r.RDG.Debug.ResourceFilter

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.ResourceFilter is to filter debug events for specific resources in the Render Dependency Graph (RDG) system of Unreal Engine 5. This setting variable is primarily used for debugging and profiling purposes within the rendering system.

This setting variable is relied upon by the RenderCore module, specifically within the Render Dependency Graph (RDG) subsystem. The RDG is a crucial part of Unreal Engine’s rendering pipeline, managing dependencies between rendering passes and resources.

The value of this variable is set through multiple methods:

  1. It can be set via console command, as it’s defined as a TAutoConsoleVariable.
  2. It can be set through command-line arguments using the “rdgdebugresourcefilter=” parameter.
  3. It can be modified at runtime through the engine’s console or configuration files.

The associated variable CVarRDGDebugResourceFilter interacts directly with r.RDG.Debug.ResourceFilter. They share the same value, with CVarRDGDebugResourceFilter being the actual console variable object, and GRDGDebugResourceFilterName storing the processed filter string.

Developers must be aware of the following when using this variable:

  1. It’s primarily intended for debugging and profiling purposes.
  2. Setting this filter will affect the debug output related to RDG resources.
  3. The filter is case-sensitive and supports wildcard patterns.

Best practices when using this variable include:

  1. Use it judiciously, as excessive debugging can impact performance.
  2. Reset the filter to ‘None’ when not actively debugging to avoid unintended filtering.
  3. Combine its use with other RDG debugging tools for comprehensive analysis.

Regarding the associated variable CVarRDGDebugResourceFilter:

The purpose of CVarRDGDebugResourceFilter is to serve as the actual console variable object for the r.RDG.Debug.ResourceFilter setting. It allows for runtime modification of the filter through the engine’s console system.

This variable is used within the RenderCore module, specifically in the RDG subsystem. It’s directly tied to the functionality of r.RDG.Debug.ResourceFilter.

The value of CVarRDGDebugResourceFilter is set through the engine’s console system or configuration files. It’s initialized with an empty string by default.

CVarRDGDebugResourceFilter interacts with GRDGDebugResourceFilterName through a console variable sink, which updates GRDGDebugResourceFilterName whenever CVarRDGDebugResourceFilter changes.

Developers should be aware that changes to CVarRDGDebugResourceFilter will immediately affect the RDG debugging output. They should also note that the variable accepts a string value, which is then processed to create the actual filter.

Best practices for using CVarRDGDebugResourceFilter include:

  1. Use descriptive resource names or patterns when setting the filter.
  2. Clear the filter (set to empty string or ‘None’) when finished debugging.
  3. Be mindful of performance implications when using detailed filters in production builds.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


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

FString GRDGDebugResourceFilterName;

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

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

}

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

FString GRDGDebugResourceFilterName;

FAutoConsoleVariableSink CVarRDGDebugResourceSink(FConsoleCommandDelegate::CreateLambda([]()
{
	GRDGDebugResourceFilterName = GetDebugFilterString(CVarRDGDebugResourceFilter.GetValueOnGameThread());
}));

bool IsDebugAllowedForResource(const TCHAR* ResourceName)
{
	return IsDebugAllowed(GRDGDebugResourceFilterName, ResourceName);
}

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

Scope (from outer to inner):

file
function     void InitRenderGraph

Source code excerpt:

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

	int32 TransientAllocatorValue = 0;
	if (FParse::Value(FCommandLine::Get(), TEXT("rdgtransientallocator="), TransientAllocatorValue))
	{