r.DumpGPU.FrameCount
r.DumpGPU.FrameCount
#Overview
name: r.DumpGPU.FrameCount
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of consecutive frames to dump (default=1).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DumpGPU.FrameCount is to control the number of consecutive frames to dump when performing GPU debugging or profiling tasks in Unreal Engine 5.
This setting variable is primarily used by the rendering system, specifically in the GPU dumping functionality. It is part of the RenderCore module, which is a core component of Unreal Engine’s rendering pipeline.
The value of this variable is set through a console variable system. It’s defined as a TAutoConsoleVariable with a default value of 1, meaning it will dump one frame by default. Developers can change this value at runtime through the console or configuration files.
The associated variable GDumpGPUFrameCount directly interacts with r.DumpGPU.FrameCount. They share the same value and purpose. GDumpGPUFrameCount is used in the C++ code to retrieve the actual value set by the console variable.
Developers must be aware that:
- This variable affects performance when active, as dumping GPU data can be resource-intensive.
- Setting a high value might result in large amounts of data being dumped, which could impact storage and processing time.
- It works in conjunction with other r.DumpGPU.* variables to control various aspects of GPU dumping.
Best practices when using this variable include:
- Use it sparingly and only when necessary for debugging or profiling.
- Start with a low value (like the default 1) and increase if more data is needed.
- Be mindful of the performance impact, especially in production environments.
- Clear any dumped data after analysis to manage storage space.
Regarding the associated variable GDumpGPUFrameCount: Its purpose is to provide a programmatic way to access the value set by r.DumpGPU.FrameCount within the C++ code of the engine. It’s used in the FRDGBuilder::BeginResourceDump function to determine how many frames should be dumped. Developers working on the rendering pipeline or creating custom rendering features might need to interact with this variable directly in code. When using it, ensure to call GetValueOnGameThread() to get the most up-to-date value, as demonstrated in the provided code snippet.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:96
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
static TAutoConsoleVariable<int32> GDumpGPUFrameCount(
TEXT("r.DumpGPU.FrameCount"), 1,
TEXT("Number of consecutive frames to dump (default=1)."),
ECVF_Default);
static TAutoConsoleVariable<int32> GDumpGPUCameraCut(
TEXT("r.DumpGPU.CameraCut"), 0,
TEXT("Whether to issue a camera cut on the first frame of the dump."),
#Associated Variable and Callsites
This variable is associated with another variable named GDumpGPUFrameCount
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:95
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> GDumpGPUFrameCount(
TEXT("r.DumpGPU.FrameCount"), 1,
TEXT("Number of consecutive frames to dump (default=1)."),
ECVF_Default);
static TAutoConsoleVariable<int32> GDumpGPUCameraCut(
TEXT("r.DumpGPU.CameraCut"), 0,
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:2084
Scope (from outer to inner):
file
function FString FRDGBuilder::BeginResourceDump
Source code excerpt:
NewResourceDumpContext->bEnableDiskWrite = GDumpTestEnableDiskWrite.GetValueOnGameThread() != 0;
NewResourceDumpContext->DeltaTime = FApp::GetDeltaTime();
NewResourceDumpContext->FrameCount = FMath::Max(GDumpGPUFrameCount.GetValueOnGameThread(), 1);
if (Switches.Contains(TEXT("upload")))
{
if (!IDumpGPUUploadServiceProvider::GProvider || !NewResourceDumpContext->bEnableDiskWrite)
{
UE_LOG(LogDumpGPU, Warning, TEXT("DumpGPU upload services are not set up."));