r.VT.NumFeedbackTasks
r.VT.NumFeedbackTasks
#Overview
name: r.VT.NumFeedbackTasks
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of tasks to create to read virtual texture feedback.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.NumFeedbackTasks is to control the number of tasks created to read virtual texture feedback in Unreal Engine 5’s rendering system. This setting is specifically related to the Virtual Texture (VT) system, which is a part of the engine’s rendering pipeline.
This setting variable is primarily used within the Renderer module of Unreal Engine 5, specifically in the Virtual Texture System. Based on the callsites, we can see that it’s defined and used in the VirtualTextureSystem.cpp file.
The value of this variable is set through a console variable (CVarVTNumFeedbackTasks) with a default value of 1. It can be modified at runtime through console commands or project settings.
The associated variable CVarVTNumFeedbackTasks directly interacts with r.VT.NumFeedbackTasks. They share the same value and purpose. This console variable is used to retrieve the actual value of the setting in the code.
Developers should be aware that this variable affects the parallelization of virtual texture feedback reading. Increasing the number of tasks could potentially improve performance by allowing more concurrent processing of virtual texture feedback, but it may also increase memory usage and CPU overhead.
Best practices when using this variable include:
- Carefully consider the performance implications before modifying the default value.
- Test thoroughly with different values to find the optimal setting for your specific project.
- Monitor performance metrics when adjusting this value to ensure it’s having the desired effect.
- Consider the target hardware capabilities when setting this value, as more powerful systems may benefit from a higher number of tasks.
Regarding the associated variable CVarVTNumFeedbackTasks:
The purpose of CVarVTNumFeedbackTasks is to provide programmatic access to the r.VT.NumFeedbackTasks setting within the C++ code of Unreal Engine 5.
This console variable is defined and used in the Renderer module, specifically in the Virtual Texture System. It’s used to retrieve the current value of the setting at runtime.
The value of CVarVTNumFeedbackTasks is set when the r.VT.NumFeedbackTasks console variable is modified, either through console commands or project settings.
CVarVTNumFeedbackTasks directly interacts with r.VT.NumFeedbackTasks, as they represent the same setting. It’s used in the FVirtualTextureUpdateSettings constructor to set the NumFeedbackTasks member variable.
Developers should be aware that changes to r.VT.NumFeedbackTasks will be reflected in CVarVTNumFeedbackTasks, and vice versa. This variable is used to access the setting value in a thread-safe manner on the render thread.
Best practices for using CVarVTNumFeedbackTasks include:
- Use GetValueOnRenderThread() when accessing the value, as shown in the code example, to ensure thread safety.
- Be cautious when modifying this value at runtime, as it can affect the behavior of the Virtual Texture System.
- Consider caching the value if it’s accessed frequently, rather than calling GetValueOnRenderThread() repeatedly.
#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:92
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarVTNumFeedbackTasks(
TEXT("r.VT.NumFeedbackTasks"),
1,
TEXT("Number of tasks to create to read virtual texture feedback."),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTEnablePlayback(
TEXT("r.VT.EnablePlayback"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTNumFeedbackTasks
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:91
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTNumFeedbackTasks(
TEXT("r.VT.NumFeedbackTasks"),
1,
TEXT("Number of tasks to create to read virtual texture feedback."),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTEnablePlayback(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:171
Scope (from outer to inner):
file
function FVirtualTextureUpdateSettings::FVirtualTextureUpdateSettings
Source code excerpt:
bForceContinuousUpdate = CVarVTForceContinuousUpdate.GetValueOnRenderThread() != 0;
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();