r.VT.MaxReleasedPerFrame
r.VT.MaxReleasedPerFrame
#Overview
name: r.VT.MaxReleasedPerFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Max number of allocated virtual textures to release per frame
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.MaxReleasedPerFrame is to control the maximum number of allocated virtual textures that can be released per frame in Unreal Engine’s Virtual Texturing system. This setting is part of the rendering and memory management system, specifically for virtual textures.
This setting variable is primarily used in the Virtual Texturing subsystem of Unreal Engine. It’s referenced in the VirtualTextureScalability namespace, which suggests it’s part of the scalability settings for virtual textures.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0 and can be changed at runtime using console commands or through configuration files.
The associated variable CVarVTMaxReleasedPerFrame directly interacts with r.VT.MaxReleasedPerFrame. They share the same value and purpose.
Developers must be aware that this variable affects the performance and memory usage of the virtual texturing system. Setting it to 0 (the default) likely means no limit on texture releases per frame, while higher values will restrict the number of textures that can be released each frame.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Monitoring performance and memory usage when changing this value.
- Using it in conjunction with other virtual texturing settings for optimal results.
Regarding the associated variable CVarVTMaxReleasedPerFrame:
The purpose of CVarVTMaxReleasedPerFrame is to provide programmatic access to the r.VT.MaxReleasedPerFrame setting within the engine’s C++ code.
This variable is used in the VirtualTextureScalability namespace and is likely accessed by various parts of the virtual texturing system to determine how many textures can be released each frame.
The value of CVarVTMaxReleasedPerFrame is set when r.VT.MaxReleasedPerFrame is set, as they share the same underlying value.
CVarVTMaxReleasedPerFrame interacts directly with the r.VT.MaxReleasedPerFrame console variable.
Developers should be aware that this is an internal variable used by the engine, and they should generally modify r.VT.MaxReleasedPerFrame rather than trying to change CVarVTMaxReleasedPerFrame directly.
Best practices include using the GetValueOnAnyThread() or GetValueOnRenderThread() methods to access the current value of this variable in C++ code, as shown in the provided code excerpt.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTextureScalability.cpp:57
Scope (from outer to inner):
file
namespace VirtualTextureScalability
Source code excerpt:
static TAutoConsoleVariable<int32> CVarVTMaxReleasedPerFrame(
TEXT("r.VT.MaxReleasedPerFrame"),
0,
TEXT("Max number of allocated virtual textures to release per frame"),
ECVF_RenderThreadSafe | ECVF_Scalability
);
static TAutoConsoleVariable<int32> CVarVTPageFreeThreshold(
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTMaxReleasedPerFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTextureScalability.cpp:56
Scope (from outer to inner):
file
namespace VirtualTextureScalability
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarVTMaxReleasedPerFrame(
TEXT("r.VT.MaxReleasedPerFrame"),
0,
TEXT("Max number of allocated virtual textures to release per frame"),
ECVF_RenderThreadSafe | ECVF_Scalability
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTextureScalability.cpp:201
Scope (from outer to inner):
file
namespace VirtualTextureScalability
function int32 GetMaxAllocatedVTReleasedPerFrame
Source code excerpt:
return 0;
#else
return CVarVTMaxReleasedPerFrame.GetValueOnAnyThread();
#endif
}
uint32 GetPageFreeThreshold()
{
return FMath::Max(CVarVTPageFreeThreshold.GetValueOnRenderThread(), 0);