renderdoc.SaveAllInitials

renderdoc.SaveAllInitials

#Overview

name: renderdoc.SaveAllInitials

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of renderdoc.SaveAllInitials is to control whether RenderDoc captures the initial state of all rendering resources when taking a frame capture. This setting is specifically for the RenderDoc plugin, which is a graphics debugging tool used in Unreal Engine.

This setting variable is primarily used by the RenderDoc plugin module in Unreal Engine. It’s part of the graphics debugging and profiling system, allowing developers to capture and analyze rendering data.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, meaning it’s disabled by default. Developers can change this value at runtime using console commands or through configuration files.

The associated variable CVarRenderDocSaveAllInitials interacts directly with renderdoc.SaveAllInitials. They share the same value and purpose.

Developers must be aware that enabling this variable (setting it to 1) will significantly increase the size of the capture file. This is because it forces RenderDoc to save the initial state of all rendering resources, even those not used in the captured frame.

Best practices when using this variable include:

  1. Keep it disabled (0) by default to minimize capture size and performance impact.
  2. Enable it (1) only when debugging specific issues related to resource initialization or when a comprehensive view of all resources is necessary.
  3. Be prepared for larger capture files and potentially slower capture times when enabled.

Regarding the associated variable CVarRenderDocSaveAllInitials:

Developers should use these variables judiciously, balancing the need for comprehensive debug information against performance and storage considerations.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:51

Scope: file

Source code excerpt:

	TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocSaveAllInitials(
	TEXT("renderdoc.SaveAllInitials"),
	0,
	TEXT("0 - Disregard initial states of resources. ")
	TEXT("1 - Always capture the initial state of all rendering resources. ")
	TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelayInSeconds(
	TEXT("renderdoc.CaptureDelayInSeconds"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:50

Scope: file

Source code excerpt:

	TEXT("1 - Include all rendering resources in the capture, even those that have not been used during the frame. ")
	TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocSaveAllInitials(
	TEXT("renderdoc.SaveAllInitials"),
	0,
	TEXT("0 - Disregard initial states of resources. ")
	TEXT("1 - Always capture the initial state of all rendering resources. ")
	TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelayInSeconds(

#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:301

Scope (from outer to inner):

file
function     void FRenderDocPluginModule::StartupModule

Source code excerpt:

	RenderDocAPI->SetCaptureOptionU32(eRENDERDOC_Option_CaptureCallstacks, CVarRenderDocCaptureCallstacks.GetValueOnAnyThread() ? 1 : 0);
	RenderDocAPI->SetCaptureOptionU32(eRENDERDOC_Option_RefAllResources, CVarRenderDocReferenceAllResources.GetValueOnAnyThread() ? 1 : 0);
	RenderDocAPI->SetCaptureOptionU32(eRENDERDOC_Option_SaveAllInitials, CVarRenderDocSaveAllInitials.GetValueOnAnyThread() ? 1 : 0);

	RenderDocAPI->MaskOverlayBits(eRENDERDOC_Overlay_None, eRENDERDOC_Overlay_None);

	static FAutoConsoleCommand CCmdRenderDocCaptureFrame = FAutoConsoleCommand(
		TEXT("renderdoc.CaptureFrame"),
		TEXT("Captures the rendering commands of the next frame and launches RenderDoc"),

#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:343

Scope (from outer to inner):

file
function     void FRenderDocPluginModule::BeginFrameCapture

Source code excerpt:

	int ok = SetOptions(eRENDERDOC_Option_CaptureCallstacks, CVarRenderDocCaptureCallstacks.GetValueOnAnyThread() ? 1 : 0); check(ok);
		ok = SetOptions(eRENDERDOC_Option_RefAllResources, CVarRenderDocReferenceAllResources.GetValueOnAnyThread() ? 1 : 0); check(ok);
		ok = SetOptions(eRENDERDOC_Option_SaveAllInitials, CVarRenderDocSaveAllInitials.GetValueOnAnyThread() ? 1 : 0); check(ok);

	HWND WindowHandle = GetActiveWindow();

	typedef FRenderDocPluginLoader::RENDERDOC_API_CONTEXT RENDERDOC_API_CONTEXT;
	FRenderDocPluginModule* Plugin = this;
	FRenderDocPluginLoader::RENDERDOC_API_CONTEXT* RenderDocAPILocal = RenderDocAPI;