r.DumpGPU.Test.EnableDiskWrite

r.DumpGPU.Test.EnableDiskWrite

#Overview

name: r.DumpGPU.Test.EnableDiskWrite

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.DumpGPU.Test.EnableDiskWrite is to control whether files should be written to disk during GPU dump operations, specifically for r.DumpGPU automation tests. This setting is primarily used to prevent filling up hard drives on worker machines during automated testing.

This setting variable is part of the rendering system, specifically related to GPU dump functionality and automation testing. It is used within the RenderCore module of Unreal Engine 5.

The value of this variable is set through a console variable system. It is initialized with a default value of 1 (enabled) in the source code.

The variable interacts with an associated C++ variable named GDumpTestEnableDiskWrite. They share the same value and purpose.

Developers must be aware that:

  1. This setting affects the behavior of r.DumpGPU automation tests.
  2. When disabled (set to 0), it prevents any files from being written to disk during GPU dump operations.
  3. It’s particularly useful for continuous integration and automated testing environments where disk space might be a concern.

Best practices when using this variable include:

  1. Keep it enabled (1) for local development and debugging to have access to full GPU dump information.
  2. Consider disabling it (0) in automated test environments to prevent unnecessary disk writes and save space.
  3. Be aware of its state when analyzing GPU dump results, as it may affect the availability of certain debug information.

Regarding the associated variable GDumpTestEnableDiskWrite:

The purpose of GDumpTestEnableDiskWrite is to provide a C++ accessible counterpart to the r.DumpGPU.Test.EnableDiskWrite console variable. It allows the engine code to quickly check whether disk writes are enabled for GPU dump operations.

This variable is used within the RenderCore module, specifically in the GPU dump functionality.

The value of this variable is set through the TAutoConsoleVariable system, which links it to the r.DumpGPU.Test.EnableDiskWrite console variable.

GDumpTestEnableDiskWrite interacts directly with r.DumpGPU.Test.EnableDiskWrite, as they represent the same setting in different contexts (console vs. C++ code).

Developers should be aware that:

  1. This variable’s value is accessed using the GetValueOnGameThread() method.
  2. It’s used to determine whether to enable disk writes in the FRDGBuilder::BeginResourceDump function.

Best practices for using this variable include:

  1. Use GetValueOnGameThread() when accessing its value to ensure thread-safety.
  2. Consider the performance implications of frequently checking this value in performance-critical code paths.
  3. Be consistent in using either the console variable or this C++ variable throughout the codebase to avoid confusion.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:140

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


static TAutoConsoleVariable<int32> GDumpTestEnableDiskWrite(
	TEXT("r.DumpGPU.Test.EnableDiskWrite"), 1,
	TEXT("Main switch whether any files should be written to disk, used for r.DumpGPU automation tests to not fill up workers' hard drive."),
	ECVF_Default);

static TAutoConsoleVariable<int32> GDumpTestPrettifyResourceFileNames(
	TEXT("r.DumpGPU.Test.PrettifyResourceFileNames"), 0,
	TEXT("Whether the resource file names should include resource name. May increase the likelyness of running into Windows' filepath limit."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:139

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<int32> GDumpTestEnableDiskWrite(
	TEXT("r.DumpGPU.Test.EnableDiskWrite"), 1,
	TEXT("Main switch whether any files should be written to disk, used for r.DumpGPU automation tests to not fill up workers' hard drive."),
	ECVF_Default);

static TAutoConsoleVariable<int32> GDumpTestPrettifyResourceFileNames(
	TEXT("r.DumpGPU.Test.PrettifyResourceFileNames"), 0,

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:2082

Scope (from outer to inner):

file
function     FString FRDGBuilder::BeginResourceDump

Source code excerpt:

	}
	NewResourceDumpContext->bStream = GDumpGPUStream.GetValueOnGameThread() != 0;
	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)