r.VT.SplitPhysicalPoolSize
r.VT.SplitPhysicalPoolSize
#Overview
name: r.VT.SplitPhysicalPoolSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Create multiple physical pools per format to keep pools at this maximum size in tiles.\nA value of 64 tiles will force 16bit page tables. This can be a page table memory optimization for large physical pools.\nDefaults to 0 (off).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.SplitPhysicalPoolSize is to control the creation of multiple physical pools for virtual textures in Unreal Engine’s rendering system. It specifically manages the maximum size of these pools in tiles, which can be used as a memory optimization technique for large physical pools.
This setting variable is primarily used by the Virtual Texture (VT) subsystem within Unreal Engine’s rendering module. It’s part of the engine’s virtual texturing system, which is crucial for managing large textures efficiently.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, which means the feature is off by default. Developers can modify this value at runtime or through configuration files.
The associated variable CVarVTSplitPhysicalPoolSize directly interacts with r.VT.SplitPhysicalPoolSize. They share the same value and purpose. This variable is used in the VirtualTexturePool::GetSplitPhysicalPoolSize() function to retrieve the current setting value.
Developers must be aware of several things when using this variable:
- Setting a value of 64 tiles will force 16-bit page tables, which can be a memory optimization for large physical pools.
- The value is clamped to be non-negative in the GetSplitPhysicalPoolSize() function.
- Changing this value affects the memory usage and potentially the performance of the virtual texturing system.
Best practices when using this variable include:
- Only modify it if you understand the implications on memory usage and rendering performance.
- Consider using it when dealing with very large virtual textures that are causing memory issues.
- Monitor the impact on performance and memory usage when adjusting this value.
- Use in conjunction with other virtual texturing settings for optimal results.
Regarding the associated variable CVarVTSplitPhysicalPoolSize:
The purpose of CVarVTSplitPhysicalPoolSize is identical to r.VT.SplitPhysicalPoolSize, as they are directly linked. It’s an implementation detail of how the console variable system in Unreal Engine works.
This variable is used internally by the engine to store and retrieve the value set by r.VT.SplitPhysicalPoolSize. It’s part of the console variable system and is typically not interacted with directly by developers.
The value of CVarVTSplitPhysicalPoolSize is set automatically when r.VT.SplitPhysicalPoolSize is modified.
CVarVTSplitPhysicalPoolSize interacts directly with the r.VT.SplitPhysicalPoolSize console command and is used in the VirtualTexturePool::GetSplitPhysicalPoolSize() function.
Developers should be aware that this is an internal variable and should not be modified directly. Instead, they should always use the r.VT.SplitPhysicalPoolSize console command to change the setting.
Best practices for CVarVTSplitPhysicalPoolSize are the same as for r.VT.SplitPhysicalPoolSize, with the additional note that developers should not attempt to access or modify this variable directly in their code. Always use the console command system for interacting with this setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTexturePoolConfig.cpp:32
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarVTSplitPhysicalPoolSize(
TEXT("r.VT.SplitPhysicalPoolSize"),
0,
TEXT("Create multiple physical pools per format to keep pools at this maximum size in tiles.\n")
TEXT("A value of 64 tiles will force 16bit page tables. This can be a page table memory optimization for large physical pools.\n")
TEXT("Defaults to 0 (off)."),
ECVF_RenderThreadSafe
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTSplitPhysicalPoolSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTexturePoolConfig.cpp:31
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarVTSplitPhysicalPoolSize(
TEXT("r.VT.SplitPhysicalPoolSize"),
0,
TEXT("Create multiple physical pools per format to keep pools at this maximum size in tiles.\n")
TEXT("A value of 64 tiles will force 16bit page tables. This can be a page table memory optimization for large physical pools.\n")
TEXT("Defaults to 0 (off)."),
ECVF_RenderThreadSafe
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VT/VirtualTexturePoolConfig.cpp:295
Scope (from outer to inner):
file
function int32 VirtualTexturePool::GetSplitPhysicalPoolSize
Source code excerpt:
int32 VirtualTexturePool::GetSplitPhysicalPoolSize()
{
return FMath::Max(CVarVTSplitPhysicalPoolSize.GetValueOnAnyThread(), 0);
}
uint32 VirtualTexturePool::GetConfigHash()
{
uint32 Hash = GetTypeHash(GetPoolSizeScale());
Hash = HashCombine(Hash, GetTypeHash(GetPoolAutoGrow()));