r.VT.EnablePlayback
r.VT.EnablePlayback
#Overview
name: r.VT.EnablePlayback
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable playback of recorded feedback requests.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.EnablePlayback is to control the playback of recorded feedback requests in the Virtual Texture system of Unreal Engine 5. This setting is primarily used for debugging and performance analysis of the Virtual Texturing system.
This setting variable is mainly used in the Renderer module of Unreal Engine, specifically within the Virtual Texture system. It’s referenced in the VirtualTextureSystem.cpp file, which is part of the core rendering functionality.
The value of this variable is set as a console variable using the TAutoConsoleVariable class. It’s initialized with a default value of 1, meaning playback is enabled by default.
The associated variable CVarVTEnablePlayback interacts directly with r.VT.EnablePlayback. They share the same value and purpose. CVarVTEnablePlayback is used to retrieve the current value of the setting in the code.
Developers must be aware that enabling this variable may impact performance, as it allows for playback of recorded feedback requests. This could be useful for debugging but might not be suitable for production builds.
Best practices when using this variable include:
- Only enable it when necessary for debugging or analyzing Virtual Texture behavior.
- Disable it in production builds to avoid potential performance overhead.
- Use in conjunction with other Virtual Texture debugging tools and settings for comprehensive analysis.
Regarding the associated variable CVarVTEnablePlayback:
The purpose of CVarVTEnablePlayback is to provide a programmatic way to access the value of r.VT.EnablePlayback within the C++ code.
It’s used in the Renderer module, specifically in the VirtualTextureSystem.cpp file, to determine whether Virtual Texture playback should be enabled.
The value of CVarVTEnablePlayback is set by the console variable system and corresponds directly to the value of r.VT.EnablePlayback.
It interacts with the FVirtualTextureUpdateSettings struct, where its value is used to initialize the bEnablePlayback member.
Developers should be aware that changes to r.VT.EnablePlayback will be reflected in CVarVTEnablePlayback, and vice versa.
Best practices for using CVarVTEnablePlayback include:
- Use GetValueOnRenderThread() to safely access its value from the render thread.
- Consider the performance implications of enabling playback in performance-critical code paths.
- Use it in conjunction with other Virtual Texture settings for a comprehensive debugging approach.
#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:98
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarVTEnablePlayback(
TEXT("r.VT.EnablePlayback"),
1,
TEXT("Enable playback of recorded feedback requests."),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarVTPlaybackMipBias(
TEXT("r.VT.PlaybackMipBias"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTEnablePlayback
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:97
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTEnablePlayback(
TEXT("r.VT.EnablePlayback"),
1,
TEXT("Enable playback of recorded feedback requests."),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarVTPlaybackMipBias(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:168
Scope (from outer to inner):
file
function FVirtualTextureUpdateSettings::FVirtualTextureUpdateSettings
Source code excerpt:
{
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();
MaxRVTPageUploads = VirtualTextureScalability::GetMaxUploadsPerFrame();