r.DumpGPU.Delay
r.DumpGPU.Delay
#Overview
name: r.DumpGPU.Delay
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Delay in seconds before dumping the frame.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DumpGPU.Delay is to set a delay in seconds before dumping GPU frame information. This variable is part of Unreal Engine’s rendering and debugging system, specifically related to the GPU frame dumping functionality.
The Unreal Engine subsystem that relies on this setting variable is the rendering core, as evidenced by its location in the RenderCore module (DumpGPU.cpp file).
The value of this variable is set through the console variable system, as it’s defined as a TAutoConsoleVariable. This means it can be changed at runtime through console commands or configuration files.
The associated variable GDumpGPUDelay directly interacts with r.DumpGPU.Delay. They share the same value and purpose.
Developers should be aware that:
- This variable affects the timing of GPU frame dumps, which are used for debugging and performance analysis.
- The delay is measured in seconds and defaults to 0.0f (no delay).
- It’s render thread safe, meaning it can be safely accessed from the render thread.
Best practices when using this variable include:
- Use it in conjunction with other GPU dumping variables like r.DumpGPU.FrameCount for comprehensive debugging.
- Be cautious when setting large delay values in production environments, as it might impact performance.
- Use it primarily for debugging and profiling purposes, not in shipping builds.
Regarding the associated variable GDumpGPUDelay:
- It’s the C++ variable that directly corresponds to the r.DumpGPU.Delay console variable.
- It’s used in the FRDGBuilder::BeginResourceDump function to determine if there should be a delay before starting the GPU dump.
- If the delay is greater than 0, it sets up a countdown (GNextDumpingRemainingTime) before the dump begins.
- Developers can access its value using GetValueOnGameThread() method, which is thread-safe for the game thread.
When working with GDumpGPUDelay, developers should ensure they’re accessing it from the appropriate thread (game thread in this case) and be aware of its impact on the GPU dumping process timing.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:91
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
static TAutoConsoleVariable<float> GDumpGPUDelay(
TEXT("r.DumpGPU.Delay"), 0.0f,
TEXT("Delay in seconds before dumping the frame."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> GDumpGPUFrameCount(
TEXT("r.DumpGPU.FrameCount"), 1,
TEXT("Number of consecutive frames to dump (default=1)."),
#Associated Variable and Callsites
This variable is associated with another variable named GDumpGPUDelay
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:90
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> GDumpGPUDelay(
TEXT("r.DumpGPU.Delay"), 0.0f,
TEXT("Delay in seconds before dumping the frame."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> GDumpGPUFrameCount(
TEXT("r.DumpGPU.FrameCount"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:2118
Scope (from outer to inner):
file
function FString FRDGBuilder::BeginResourceDump
Source code excerpt:
check(GNextRDGResourceDumpContext == nullptr);
GNextRDGResourceDumpContext = NewResourceDumpContext;
if (GDumpGPUDelay.GetValueOnGameThread() > 0.0f)
{
GNextDumpingRemainingTime = GDumpGPUDelay.GetValueOnGameThread();
UE_LOG(LogDumpGPU, Display, TEXT("DumpGPU to %s armed for %d frames starting in %f seconds."), *NewResourceDumpContext->DumpingDirectoryPath, NewResourceDumpContext->FrameCount, GNextDumpingRemainingTime);
}
else
{
UE_LOG(LogDumpGPU, Display, TEXT("Dump to %s armed for %d frames starting next frame."), *NewResourceDumpContext->DumpingDirectoryPath, NewResourceDumpContext->FrameCount);
}