r.RDG.Debug.DisableTransientResources

r.RDG.Debug.DisableTransientResources

#Overview

name: r.RDG.Debug.DisableTransientResources

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.Debug.DisableTransientResources is to control the behavior of transient resource allocation in the Render Dependency Graph (RDG) system of Unreal Engine 5. It is primarily used for debugging and optimization of the rendering pipeline.

This setting variable is part of the rendering system, specifically the Render Dependency Graph (RDG) subsystem. The RDG is a core component of Unreal Engine’s rendering architecture, responsible for managing render pass dependencies and resource allocation.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.

GRDGDebugDisableTransientResources is the associated C++ variable that directly interacts with r.RDG.Debug.DisableTransientResources. They share the same value and purpose.

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

  1. It’s primarily intended for debugging purposes.
  2. Enabling this variable can significantly impact rendering performance, as it prevents the use of transient resources.
  3. The variable has different behaviors based on its value (0, 1, 2, or 3).

Best practices when using this variable include:

  1. Use it only during development and debugging, not in production builds.
  2. Combine it with r.rdg.debug.resourcefilter to fine-tune which resources are affected.
  3. Be aware of the performance implications when enabled.

Regarding GRDGDebugDisableTransientResources:

This is the C++ variable that directly corresponds to r.RDG.Debug.DisableTransientResources. It’s used in the engine code to control the behavior of transient resource allocation. When this variable is non-zero, it affects how the IsTransientInternal function behaves in the FRDGBuilder class.

The variable can have the following values: 0: Normal behavior (transient resources enabled) 1: Disable all transient resources 2: Disable transient buffers only 3: Disable transient textures only

Developers should be cautious when modifying this variable directly in C++ code, as it’s primarily intended to be controlled through the console variable system for debugging purposes.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

int32 GRDGDebugDisableTransientResources = 0;
FAutoConsoleVariableRef CVarRDGDebugDisableTransientResource(
	TEXT("r.RDG.Debug.DisableTransientResources"),
	GRDGDebugDisableTransientResources,
	TEXT("Filters out transient resources from the transient allocator. Use r.rdg.debug.resourcefilter to specify the filter. Defaults to all resources if enabled."),
	ECVF_RenderThreadSafe);

int32 GRDGBreakpoint = 0;
FAutoConsoleVariableRef CVarRDGBreakpoint(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphBuilder.cpp:516

Scope (from outer to inner):

file
function     bool FRDGBuilder::IsTransientInternal

Source code excerpt:


#if RDG_ENABLE_DEBUG
	if (GRDGDebugDisableTransientResources != 0)
	{
		const bool bDebugAllowed = IsDebugAllowedForResource(Resource->Name);

		if (GRDGDebugDisableTransientResources == 2 && Resource->Type == ERDGViewableResourceType::Buffer && bDebugAllowed)
		{
			return false;
		}

		if (GRDGDebugDisableTransientResources == 3 && Resource->Type == ERDGViewableResourceType::Texture && bDebugAllowed)
		{
			return false;
		}
	}
#endif

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

int32 GRDGDebugDisableTransientResources = 0;
FAutoConsoleVariableRef CVarRDGDebugDisableTransientResource(
	TEXT("r.RDG.Debug.DisableTransientResources"),
	GRDGDebugDisableTransientResources,
	TEXT("Filters out transient resources from the transient allocator. Use r.rdg.debug.resourcefilter to specify the filter. Defaults to all resources if enabled."),
	ECVF_RenderThreadSafe);

int32 GRDGBreakpoint = 0;
FAutoConsoleVariableRef CVarRDGBreakpoint(
	TEXT("r.RDG.Breakpoint"),

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:35

Scope: file

Source code excerpt:

extern int32 GRDGDebugFlushGPU;
extern int32 GRDGDebugExtendResourceLifetimes;
extern int32 GRDGDebugDisableTransientResources;
extern int32 GRDGBreakpoint;
extern int32 GRDGTransitionLog;
extern int32 GRDGImmediateMode;
extern int32 GRDGOverlapUAVs;
extern bool  GRDGAllowRHIAccess;

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:98

Scope: file

Source code excerpt:

const int32 GRDGDebugFlushGPU = 0;
const int32 GRDGDebugExtendResourceLifetimes = 0;
const int32 GRDGDebugDisableTransientResources = 0;
const int32 GRDGBreakpoint = 0;
const int32 GRDGTransitionLog = 0;
const int32 GRDGImmediateMode = 0;
const int32 GRDGOverlapUAVs = 1;

#define RDG_ALLOW_RHI_ACCESS_SCOPE()