r.DumpGPU.Upload.CompressResources

r.DumpGPU.Upload.CompressResources

#Overview

name: r.DumpGPU.Upload.CompressResources

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.Upload.CompressResources is to control the compression of resource binary data when uploading GPU dumps. It is primarily used for debugging and performance analysis of the rendering system in Unreal Engine 5.

This setting variable is utilized within the RenderCore module of Unreal Engine, specifically in the GPU dumping functionality. Based on the callsites, it’s clear that this variable is closely tied to the rendering system and GPU resource management.

The value of this variable is set through a console variable system, allowing it to be changed at runtime. It’s defined as a TAutoConsoleVariable with three possible integer values: 0: Disabled (no compression) 1: Use Zlib compression 2: Use GZip compression

The associated variable GDumpGPUUploadCompressResources interacts directly with r.DumpGPU.Upload.CompressResources. They share the same value and purpose, with GDumpGPUUploadCompressResources being the C++ representation of the console variable.

Developers should be aware that this variable affects the performance and size of GPU dumps. Enabling compression (options 1 or 2) will reduce the size of the dumps but may increase the time taken to generate them. The choice between Zlib and GZip compression methods allows for different trade-offs between compression ratio and speed.

Best practices when using this variable include:

  1. Use compression (options 1 or 2) when storage space is a concern or when uploading dumps over a network.
  2. Use the uncompressed option (0) when dump generation speed is critical or when working with tools that expect uncompressed data.
  3. Consider the target analysis tools when choosing between Zlib and GZip, as some tools may have preferences or requirements for specific compression formats.
  4. Be mindful of the performance impact when enabling compression, especially in scenarios where frequent GPU dumps are generated.

Regarding the associated variable GDumpGPUUploadCompressResources:

This C++ variable directly corresponds to the r.DumpGPU.Upload.CompressResources console variable. It’s used within the engine code to retrieve the current compression setting when performing GPU dumps. The variable is accessed using the GetValueOnGameThread() method, which ensures thread-safe access to the current value.

Developers working directly with the C++ code should use GDumpGPUUploadCompressResources when they need to programmatically check or react to the current compression setting for GPU dumps. It’s important to note that changes to this variable will affect all GPU dumps generated by the engine, so it should be modified with caution and consideration for the entire system’s performance and behavior.

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


static TAutoConsoleVariable<int32> GDumpGPUUploadCompressResources(
	TEXT("r.DumpGPU.Upload.CompressResources"), 1,
	TEXT("Whether to compress resource binary.\n")
	TEXT(" 0: Disabled (default)\n")
	TEXT(" 1: Zlib\n")
	TEXT(" 2: GZip"),
	ECVF_Default);

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<int32> GDumpGPUUploadCompressResources(
	TEXT("r.DumpGPU.Upload.CompressResources"), 1,
	TEXT("Whether to compress resource binary.\n")
	TEXT(" 0: Disabled (default)\n")
	TEXT(" 1: Zlib\n")
	TEXT(" 2: GZip"),
	ECVF_Default);

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

Scope (from outer to inner):

file
function     FString FRDGBuilder::BeginResourceDump

Source code excerpt:

	if (NewResourceDumpContext->bUpload)
	{
		if (GDumpGPUUploadCompressResources.GetValueOnGameThread() == 1)
		{
			NewResourceDumpContext->UploadResourceCompressionName = NAME_Zlib;
		}
		else if (GDumpGPUUploadCompressResources.GetValueOnGameThread() == 2)
		{
			NewResourceDumpContext->UploadResourceCompressionName = NAME_Gzip;
		}
	}

	NewResourceDumpContext->bShowInExplore = NewResourceDumpContext->bEnableDiskWrite && GDumpExploreCVar.GetValueOnGameThread() != 0 && !NewResourceDumpContext->bUpload;