renderdoc.CaptureDelay

renderdoc.CaptureDelay

#Overview

name: renderdoc.CaptureDelay

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 renderdoc.CaptureDelay is to introduce a delay before RenderDoc triggers a capture of the rendering process. This setting is part of the RenderDoc plugin, which is a graphics debugging tool integrated into Unreal Engine 5.

This setting variable is primarily used by the RenderDoc plugin, which is part of Unreal Engine’s developer tools. It’s specifically utilized within the RenderDocPlugin module.

The value of this variable is set through a console variable (CVar) system. It can be modified at runtime through the console or in configuration files.

The associated variable CVarRenderDocCaptureDelay interacts directly with renderdoc.CaptureDelay. They share the same value and purpose.

Developers must be aware that:

  1. The delay can be in frames or seconds, depending on the CaptureDelayInSeconds setting.
  2. A value greater than 0 will cause RenderDoc to wait before triggering a capture.
  3. This setting affects the timing of capture initiation, which can be crucial for debugging specific rendering issues.

Best practices when using this variable include:

  1. Use it in conjunction with CaptureDelayInSeconds to precisely control when captures occur.
  2. Set an appropriate delay to capture the exact frame or moment you’re interested in debugging.
  3. Remember to reset the value to 0 when not needed to avoid unexpected delays in captures.

Regarding the associated variable CVarRenderDocCaptureDelay:

The purpose of CVarRenderDocCaptureDelay is identical to renderdoc.CaptureDelay. It’s the C++ representation of the console variable.

This variable is used within the RenderDocPlugin module to access and apply the capture delay setting.

The value is set through the TAutoConsoleVariable system, which allows it to be modified via console commands or configuration files.

CVarRenderDocCaptureDelay directly interacts with the renderdoc.CaptureDelay console variable, effectively serving as its C++ interface.

Developers should be aware that:

  1. This variable is used in the actual implementation of the capture delay functionality.
  2. Changes to this variable will immediately affect the behavior of the RenderDoc capture system.

Best practices include:

  1. Use CVarRenderDocCaptureDelay.GetValueOnAnyThread() to safely access the current delay value from any thread.
  2. Consider the performance implications of frequently checking this value in performance-critical code paths.
  3. When modifying this value programmatically, ensure it’s done in a thread-safe manner.

#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:62

Scope: file

Source code excerpt:

	TEXT("1 - Capture delay's unit is in seconds."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelay(
	TEXT("renderdoc.CaptureDelay"),
	0,
	TEXT("If > 0, RenderDoc will trigger the capture only after this amount of time (or frames, if CaptureDelayInSeconds is false) has passed."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureFrameCount(
	TEXT("renderdoc.CaptureFrameCount"),
	0,
	TEXT("If > 0, the RenderDoc capture will encompass more than a single frame. Note: this implies that all activity in all viewports and editor windows will be captured (i.e. same as CaptureAllActivity)"));

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	TEXT("0 - Capture delay's unit is in frames.")
	TEXT("1 - Capture delay's unit is in seconds."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelay(
	TEXT("renderdoc.CaptureDelay"),
	0,
	TEXT("If > 0, RenderDoc will trigger the capture only after this amount of time (or frames, if CaptureDelayInSeconds is false) has passed."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureFrameCount(
	TEXT("renderdoc.CaptureFrameCount"),
	0,

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

Scope (from outer to inner):

file
function     void FRenderDocPluginModule::CaptureFrame

Source code excerpt:

	check(IsInGameThread());

	int32 FrameDelay = CVarRenderDocCaptureDelay.GetValueOnAnyThread();

	// Don't do anything if we're currently already waiting for a capture to end : 
	if (bCaptureInProgress)
	{
		return;
	}