r.Test.FreezeTemporalSequences

r.Test.FreezeTemporalSequences

#Overview

name: r.Test.FreezeTemporalSequences

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.Test.FreezeTemporalSequences is to freeze all temporal sequences in the rendering system. This setting variable is primarily used for testing and debugging purposes within Unreal Engine’s rendering pipeline.

This setting variable is utilized by the rendering subsystem of Unreal Engine, specifically within the scene visibility component. It’s defined and used in the SceneVisibility.cpp file, which is part of the Renderer module.

The value of this variable is set through a console variable (CVarFreezeTemporalSequences) using the TAutoConsoleVariable template. It’s initialized with a default value of 0, meaning temporal sequences are not frozen by default.

This variable interacts closely with another variable, CVarFreezeTemporalHistories. In the PrepareViewStateForVisibility function, both variables are checked to determine if temporal sequences should be frozen.

Developers must be aware that this variable is intended for testing purposes, as indicated by its “r.Test” prefix. Enabling this feature will freeze all temporal sequences, which could significantly impact the visual output and performance of the rendering system.

Best practices when using this variable include:

  1. Only enable it during debugging or testing scenarios.
  2. Be cautious when using it in production environments, as it may affect rendering quality and performance.
  3. Consider the interaction with CVarFreezeTemporalHistories when manipulating this variable.

Regarding the associated variable CVarFreezeTemporalSequences:

The purpose of CVarFreezeTemporalSequences is to provide a programmatic interface to control the r.Test.FreezeTemporalSequences setting. It’s an instance of TAutoConsoleVariable, which allows the setting to be changed at runtime through the console or code.

This variable is used directly in the rendering subsystem to determine whether temporal sequences should be frozen. It’s defined in the same file (SceneVisibility.cpp) and is part of the Renderer module.

The value of CVarFreezeTemporalSequences is set when initializing the TAutoConsoleVariable instance. It can be modified at runtime using console commands or through C++ code using the SetValueOnRenderThread() method.

CVarFreezeTemporalSequences interacts with the r.Test.FreezeTemporalSequences console variable, effectively controlling its value. It’s also used in conjunction with CVarFreezeTemporalHistories to determine the overall freezing behavior of temporal sequences and histories.

Developers should be aware that this variable is accessed on the render thread, as indicated by the GetValueOnRenderThread() method used in the code.

Best practices for using CVarFreezeTemporalSequences include:

  1. Access its value using GetValueOnRenderThread() when in render thread context.
  2. Use it in conjunction with other rendering-related variables for comprehensive control over the rendering pipeline during testing and debugging.
  3. Remember that changes to this variable will affect all temporal sequences in the scene.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:351

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarFreezeTemporalSequences(
	TEXT("r.Test.FreezeTemporalSequences"), 0,
	TEXT("Freezes all temporal sequences."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<float> CVarFreezeTemporalHistories(
	TEXT("r.Test.FreezeTemporalHistories"), 0,
	TEXT("Freezes all temporal histories as well as the temporal sequence."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:350

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<float> CVarFreezeTemporalSequences(
	TEXT("r.Test.FreezeTemporalSequences"), 0,
	TEXT("Freezes all temporal sequences."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<float> CVarFreezeTemporalHistories(
	TEXT("r.Test.FreezeTemporalHistories"), 0,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:4740

Scope (from outer to inner):

file
function     void FSceneRenderer::PrepareViewStateForVisibility

Source code excerpt:

	}

	bool bFreezeTemporalSequences = bFreezeTemporalHistories || CVarFreezeTemporalSequences.GetValueOnRenderThread() != 0;
#endif

	// Load this field once so it has a consistent value for all views (and to avoid the atomic load in the loop).
	// While the value may not be perfectly in sync when we render other view families, this is ok as this
	// invalidation mechanism is only used for interactive rendering where we expect to be constantly drawing the scene.
	// Therefore it is acceptable for some view families to be a frame or so behind others.