r.RDG.TransitionLog
r.RDG.TransitionLog
#Overview
name: r.RDG.TransitionLog
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Logs resource transitions to the console.\n 0: disabled(default);\n>0: enabled for N frames;\n<0: enabled;\n
It is referenced in 10
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RDG.TransitionLog is to enable logging of resource transitions to the console in Unreal Engine’s Render Dependency Graph (RDG) system. This setting is part of the rendering system, specifically the RDG subsystem.
The RDG system, which is part of Unreal Engine’s rendering core, relies on this setting variable. It’s primarily used in the RenderCore module, as evidenced by the file locations in the callsites.
The value of this variable is set through a console variable (cvar) named “r.RDG.TransitionLog”. It’s associated with the C++ variable GRDGTransitionLog, which shares the same value.
The variable interacts with several other RDG-related variables and systems, including GRDGDebug, GRDGDebugFlushGPU, and others. It’s used in conditional statements to control the behavior of the RDG system, particularly in relation to logging and debugging.
Developers must be aware that:
- This variable affects performance when enabled, as it logs transitions to the console.
- It’s primarily a debugging tool and should be used judiciously in production environments.
- The variable can be set to different values for different behaviors:
- 0: disabled (default)
-
0: enabled for N frames
- <0: enabled indefinitely
Best practices when using this variable include:
- Use it temporarily for debugging purposes, not in shipping builds.
- Be aware of the performance impact when enabled.
- Use in conjunction with other RDG debugging tools for comprehensive analysis.
Regarding the associated variable GRDGTransitionLog:
The purpose of GRDGTransitionLog is to serve as the C++ representation of the r.RDG.TransitionLog console variable. It’s used internally by the engine to control the behavior specified by r.RDG.TransitionLog.
This variable is used in various parts of the RenderCore module, particularly in the RDG system. It’s checked in multiple locations to determine whether to log transitions or modify certain behaviors of the RDG system.
The value of GRDGTransitionLog is set through the console variable r.RDG.TransitionLog, but it can also be modified programmatically, as seen in the InitRenderGraph function.
GRDGTransitionLog interacts closely with other RDG-related variables and is often used in conditional statements alongside them.
Developers should be aware that:
- Modifying this variable directly (rather than through the console variable) might lead to inconsistent behavior.
- The variable is used in performance-critical code paths, so frequent checking or modification could impact performance.
Best practices for using GRDGTransitionLog include:
- Prefer modifying through the console variable r.RDG.TransitionLog rather than directly.
- Be aware of its impact on various RDG systems when enabled.
- Use it in conjunction with other RDG debugging variables for comprehensive debugging.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:93
Scope: file
Source code excerpt:
int32 GRDGTransitionLog = 0;
FAutoConsoleVariableRef CVarRDGTransitionLog(
TEXT("r.RDG.TransitionLog"), GRDGTransitionLog,
TEXT("Logs resource transitions to the console.\n")
TEXT(" 0: disabled(default);\n")
TEXT(">0: enabled for N frames;\n")
TEXT("<0: enabled;\n"),
ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named GRDGTransitionLog
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphBuilder.cpp:352
Scope (from outer to inner):
file
function void FRDGBuilder::TickPoolElements
Source code excerpt:
#if RDG_ENABLE_DEBUG
if (GRDGTransitionLog > 0)
{
--GRDGTransitionLog;
}
#endif
#if RDG_STATS
CSV_CUSTOM_STAT(RDGCount, Passes, GRDGStatPassCount, ECsvCustomStatOp::Set);
CSV_CUSTOM_STAT(RDGCount, Buffers, GRDGStatBufferCount, ECsvCustomStatOp::Set);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:91
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
int32 GRDGTransitionLog = 0;
FAutoConsoleVariableRef CVarRDGTransitionLog(
TEXT("r.RDG.TransitionLog"), GRDGTransitionLog,
TEXT("Logs resource transitions to the console.\n")
TEXT(" 0: disabled(default);\n")
TEXT(">0: enabled for N frames;\n")
TEXT("<0: enabled;\n"),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:540
Scope (from outer to inner):
file
function void InitRenderGraph
Source code excerpt:
{
// Set to -1 to specify infinite number of frames.
GRDGTransitionLog = -1;
}
int32 BreakpointValue = 0;
if (FParse::Value(FCommandLine::Get(), TEXT("rdgbreakpoint="), BreakpointValue))
{
GRDGBreakpoint = BreakpointValue;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:633
Scope (from outer to inner):
file
function bool IsParallelExecuteEnabled
Source code excerpt:
&& !GRDGDebug
&& !GRDGDebugFlushGPU
&& !GRDGTransitionLog
&& !IsMobilePlatform(GMaxRHIShaderPlatform)
&& !IsOpenGLPlatform(GMaxRHIShaderPlatform)
&& !IsVulkanMobileSM5Platform(GMaxRHIShaderPlatform)
&& GRHISupportsMultithreadedShaderCreation
#if WITH_DUMPGPU
&& !UE::RenderCore::DumpGPU::IsDumpingFrame()
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp:652
Scope (from outer to inner):
file
function bool IsParallelSetupEnabled
Source code excerpt:
&& !IsImmediateMode()
&& !GRDGDebug
&& !GRDGTransitionLog
&& !IsMobilePlatform(GMaxRHIShaderPlatform)
&& !IsOpenGLPlatform(GMaxRHIShaderPlatform)
&& !IsVulkanMobileSM5Platform(GMaxRHIShaderPlatform)
&& GRHISupportsMultithreadedShaderCreation
#if WITH_DUMPGPU
&& !UE::RenderCore::DumpGPU::IsDumpingFrame()
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:37
Scope: file
Source code excerpt:
extern int32 GRDGDebugDisableTransientResources;
extern int32 GRDGBreakpoint;
extern int32 GRDGTransitionLog;
extern int32 GRDGImmediateMode;
extern int32 GRDGOverlapUAVs;
extern bool GRDGAllowRHIAccess;
class FRDGAllowRHIAccessScope
{
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.h:100
Scope: file
Source code excerpt:
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()
#define EmitRDGWarningf(WarningMessageFormat, ...)
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphValidation.cpp:1331
Scope (from outer to inner):
file
function void FRDGBarrierValidation::ValidateBarrierBatchBegin
Source code excerpt:
void FRDGBarrierValidation::ValidateBarrierBatchBegin(const FRDGPass* Pass, const FRDGBarrierBatchBegin& Batch)
{
if (!GRDGTransitionLog)
{
return;
}
FResourceMap* ResourceMap = BatchMap.Find(&Batch);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderGraphValidation.cpp:1449
Scope (from outer to inner):
file
function void FRDGBarrierValidation::ValidateBarrierBatchEnd
Source code excerpt:
void FRDGBarrierValidation::ValidateBarrierBatchEnd(const FRDGPass* Pass, const FRDGBarrierBatchEnd& Batch)
{
if (!GRDGTransitionLog || !IsDebugAllowedForGraph(GraphName) || !IsDebugAllowedForPass(Pass->GetName()))
{
return;
}
const bool bAllowedForPass = IsDebugAllowedForGraph(GraphName) && IsDebugAllowedForPass(Pass->GetName());