r.DumpGPU.Texture
r.DumpGPU.Texture
#Overview
name: r.DumpGPU.Texture
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to dump textures.\n 0: Ignores all textures\n 1: Dump only textures\' descriptors\n 2: Dump textures\' descriptors and binaries (default)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DumpGPU.Texture is to control the dumping of GPU textures for debugging and performance analysis. This setting variable is part of the rendering system in Unreal Engine 5, specifically related to GPU resource management and diagnostics.
The Unreal Engine subsystem that relies on this setting variable is the RenderCore module, as evidenced by its implementation in the DumpGPU.cpp file within the RenderCore directory.
The value of this variable is set through the console variable system in Unreal Engine. It is initialized with a default value of 2, but can be changed at runtime using console commands or through configuration files.
This variable interacts directly with its associated variable GDumpTextureCVar, which is an instance of TAutoConsoleVariable
Developers must be aware that this variable affects performance and disk usage when enabled, as it can generate large amounts of data when dumping texture information and binaries. It should be used judiciously, primarily for debugging and optimization purposes.
Best practices when using this variable include:
- Use it only when necessary for debugging or performance analysis.
- Be mindful of the performance impact, especially when set to 2 (full dump).
- Ensure sufficient disk space is available when enabling full dumps.
- Remember to disable it (set to 0) in production builds.
Regarding the associated variable GDumpTextureCVar:
The purpose of GDumpTextureCVar is to provide a programmatic interface to the r.DumpGPU.Texture setting. It allows C++ code to read and potentially modify the dump texture behavior at runtime.
This variable is used within the RenderCore module, specifically in the DumpGPU functionality.
The value of GDumpTextureCVar is set when r.DumpGPU.Texture is modified, as they are directly linked.
GDumpTextureCVar interacts with the AddDumpTextureSubResourcePass and AddDumpBufferPass functions, which use its value to determine the level of texture dumping to perform.
Developers should be aware that GDumpTextureCVar is accessed using the GetValueOnRenderThread() method, indicating that it should only be used in render thread contexts.
Best practices for using GDumpTextureCVar include:
- Access it only from the render thread to avoid potential race conditions.
- Use it for conditional logic in render-related code to control texture dumping behavior.
- Consider performance implications when frequently querying its value in performance-critical code paths.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:65
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
static TAutoConsoleVariable<int32> GDumpTextureCVar(
TEXT("r.DumpGPU.Texture"), 2,
TEXT("Whether to dump textures.\n")
TEXT(" 0: Ignores all textures\n")
TEXT(" 1: Dump only textures' descriptors\n")
TEXT(" 2: Dump textures' descriptors and binaries (default)"),
ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named GDumpTextureCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:64
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<int32> GDumpTextureCVar(
TEXT("r.DumpGPU.Texture"), 2,
TEXT("Whether to dump textures.\n")
TEXT(" 0: Ignores all textures\n")
TEXT(" 1: Dump only textures' descriptors\n")
TEXT(" 2: Dump textures' descriptors and binaries (default)"),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1357
Scope (from outer to inner):
file
function void AddDumpTextureSubResourcePass
Source code excerpt:
bool bAllowDumpBinary)
{
int32 DumpTextureMode = GDumpTextureCVar.GetValueOnRenderThread();
if (DumpTextureMode == 0)
{
return;
}
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1622
Scope (from outer to inner):
file
function void AddDumpBufferPass
Source code excerpt:
bool bIsOutputResource)
{
int32 DumpBufferMode = GDumpTextureCVar.GetValueOnRenderThread();
if (DumpBufferMode == 0)
{
return;
}