r.VT.EnableFeedback

r.VT.EnableFeedback

#Overview

name: r.VT.EnableFeedback

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.VT.EnableFeedback is to control the processing of the GPU-generated feedback buffer in Unreal Engine’s Virtual Texturing system. This setting is part of the rendering system, specifically related to virtual texturing.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Virtual Texturing (VT) system. This can be seen from the file path where the variable is defined: Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1, meaning the feedback processing is enabled by default. Users can change this value at runtime using console commands.

This variable interacts with other virtual texturing-related variables, as seen in the FVirtualTextureUpdateSettings constructor. It’s used alongside other settings like bEnablePlayback, bForceContinuousUpdate, and bParallelFeedbackTasks.

Developers must be aware that this variable affects the performance and behavior of the virtual texturing system. Enabling feedback processing (default setting) allows the system to adapt to the current rendering needs, potentially improving texture streaming efficiency.

Best practices when using this variable include:

  1. Leave it enabled (default) for most scenarios to benefit from adaptive virtual texturing.
  2. Consider disabling it temporarily for performance profiling or debugging specific issues related to virtual texturing.
  3. Be cautious when changing this setting in a shipping game, as it may affect performance and visual quality.

Regarding the associated variable CVarVTEnableFeedback:

This is the actual console variable object that controls the r.VT.EnableFeedback setting. It’s an instance of TAutoConsoleVariable, which means it’s an integer-type console variable.

The purpose of CVarVTEnableFeedback is to provide a programmatic interface for reading and potentially modifying the r.VT.EnableFeedback setting within the engine’s C++ code.

It’s used in the FVirtualTextureUpdateSettings constructor to initialize the bEnableFeedback member variable. This suggests that the setting is checked when updating virtual textures.

Developers should be aware that changes to this CVar will affect the engine’s behavior at runtime. It’s thread-safe for the render thread, as indicated by the ECVF_RenderThreadSafe flag.

Best practices for using CVarVTEnableFeedback include:

  1. Use GetValueOnRenderThread() when accessing its value from the render thread.
  2. Be cautious about modifying it during runtime, as it may impact performance and visual quality.
  3. Consider exposing it through appropriate user interfaces if runtime configuration is needed for your specific use case.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:80

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarVTEnableFeedback(
	TEXT("r.VT.EnableFeedback"),
	1,
	TEXT("Enable processing of the GPU generated feedback buffer."),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTParallelFeedbackTasks(
	TEXT("r.VT.ParallelFeedbackTasks"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:79

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarVTEnableFeedback(
	TEXT("r.VT.EnableFeedback"),
	1,
	TEXT("Enable processing of the GPU generated feedback buffer."),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTParallelFeedbackTasks(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:167

Scope (from outer to inner):

file
function     FVirtualTextureUpdateSettings::FVirtualTextureUpdateSettings

Source code excerpt:

FVirtualTextureUpdateSettings::FVirtualTextureUpdateSettings()
{
	bEnableFeedback = CVarVTEnableFeedback.GetValueOnRenderThread() != 0;
	bEnablePlayback = CVarVTEnablePlayback.GetValueOnRenderThread() != 0;
	bForceContinuousUpdate = CVarVTForceContinuousUpdate.GetValueOnRenderThread() != 0;
	bParallelFeedbackTasks = CVarVTParallelFeedbackTasks.GetValueOnRenderThread() != 0;
	NumFeedbackTasks = CVarVTNumFeedbackTasks.GetValueOnRenderThread();
	NumGatherTasks = CVarVTNumGatherTasks.GetValueOnRenderThread();
	MaxGatherPagesBeforeFlush = CVarVTPageUpdateFlushCount.GetValueOnRenderThread();