r.VT.NumGatherTasks

r.VT.NumGatherTasks

#Overview

name: r.VT.NumGatherTasks

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.NumGatherTasks is to control the number of tasks created to combine virtual texture feedback in Unreal Engine’s rendering system. This setting is specifically related to the Virtual Texture (VT) system, which is part of the engine’s advanced rendering capabilities.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the Virtual Texture system. Based on the callsites, it’s evident that this variable is utilized in the VirtualTextureSystem.cpp file, which is part of the core rendering pipeline.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, but can be changed at runtime or through configuration files. The associated C++ variable is CVarVTNumGatherTasks, which is used to access and modify the value programmatically.

This variable interacts closely with other Virtual Texture related settings, such as CVarVTParallelFeedbackTasks and CVarVTNumFeedbackTasks. It’s part of a larger set of parameters that control the behavior and performance of the Virtual Texture system.

Developers must be aware that changing this value can impact the performance and behavior of the Virtual Texture system. Increasing the number of gather tasks may improve performance on systems with more cores, but it could also increase overhead if set too high.

Best practices when using this variable include:

  1. Testing different values to find the optimal setting for your specific use case and target hardware.
  2. Considering the relationship between this variable and other VT-related settings.
  3. Monitoring performance metrics when adjusting this value to ensure it’s providing the desired benefits.

Regarding the associated variable CVarVTNumGatherTasks, it serves as the C++ representation of the r.VT.NumGatherTasks console variable. It’s used within the engine code to retrieve the current value of the setting, as seen in the FVirtualTextureUpdateSettings constructor. This variable allows the engine to access the user-defined or default value of r.VT.NumGatherTasks and apply it to the Virtual Texture system’s behavior at runtime.

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

Scope: file

Source code excerpt:

);
static TAutoConsoleVariable<int32> CVarVTNumGatherTasks(
	TEXT("r.VT.NumGatherTasks"),
	1,
	TEXT("Number of tasks to create to combine virtual texture feedback."),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTPageUpdateFlushCount(
	TEXT("r.VT.PageUpdateFlushCount"),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTNumGatherTasks(
	TEXT("r.VT.NumGatherTasks"),
	1,
	TEXT("Number of tasks to create to combine virtual texture feedback."),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTPageUpdateFlushCount(

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

Scope (from outer to inner):

file
function     FVirtualTextureUpdateSettings::FVirtualTextureUpdateSettings

Source code excerpt:

	bParallelFeedbackTasks = CVarVTParallelFeedbackTasks.GetValueOnRenderThread() != 0;
	NumFeedbackTasks = CVarVTNumFeedbackTasks.GetValueOnRenderThread();
	NumGatherTasks = CVarVTNumGatherTasks.GetValueOnRenderThread();
	MaxGatherPagesBeforeFlush = CVarVTPageUpdateFlushCount.GetValueOnRenderThread();
	MaxRVTPageUploads = VirtualTextureScalability::GetMaxUploadsPerFrame();
	MaxSVTPageUploads = VirtualTextureScalability::GetMaxUploadsPerFrameForStreamingVT();
	MaxPagesProduced = VirtualTextureScalability::GetMaxPagesProducedPerFrame();
	MaxContinuousUpdates = VirtualTextureScalability::GetMaxContinuousUpdatesPerFrame();
}