r.Streaming.PoolSize.VRAMPercentageClamp
r.Streaming.PoolSize.VRAMPercentageClamp
#Overview
name: r.Streaming.PoolSize.VRAMPercentageClamp
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When using PoolSizeVRAMPercentage, a maximum amout of memory to reserve in MB.\nThis avoids reserving too much space for systems with a lot of VRAM. (default=1024)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.PoolSize.VRAMPercentageClamp is to set a maximum limit on the amount of memory reserved for texture streaming when using the PoolSizeVRAMPercentage setting. This variable is part of Unreal Engine’s rendering and resource management system, specifically the texture streaming subsystem.
This setting variable is primarily used in the Engine module, specifically within the texture streaming helpers. Based on the callsites, it’s clear that the FRenderAssetStreamingSettings class relies on this variable to update its configuration.
The value of this variable is set as a console variable with a default value of 1024 MB. It can be changed at runtime through console commands or programmatically.
The associated variable CVarStreamingVRAMPercentageClamp interacts directly with r.Streaming.PoolSize.VRAMPercentageClamp. It’s the C++ representation of the console variable and is used to retrieve the current value of the setting.
Developers must be aware that this variable is marked with ECVF_Cheat flag, which means it’s intended for development and debugging purposes and should not be exposed to end-users in production builds.
Best practices when using this variable include:
- Carefully consider the target hardware when adjusting this value, as it directly impacts memory usage.
- Use it in conjunction with the PoolSizeVRAMPercentage setting to fine-tune texture streaming memory allocation.
- Monitor performance and memory usage when adjusting this value to find the optimal setting for your specific use case.
- Remember that this is a clamp, so it sets an upper limit – the actual memory used may be less depending on other factors.
Regarding the associated variable CVarStreamingVRAMPercentageClamp:
The purpose of CVarStreamingVRAMPercentageClamp is to provide a C++ interface to the r.Streaming.PoolSize.VRAMPercentageClamp console variable. It allows the engine code to read and potentially modify the value of this setting programmatically.
This variable is used within the Engine module, specifically in the texture streaming system. It’s accessed in the FRenderAssetStreamingSettings::Update() function to update the VRAMPercentageClamp member of the FRenderAssetStreamingSettings struct.
The value of this variable is set when the console variable is initialized, but it can be changed at runtime through console commands or programmatically using the console variable interface.
CVarStreamingVRAMPercentageClamp interacts directly with r.Streaming.PoolSize.VRAMPercentageClamp, essentially serving as its in-code representation.
Developers should be aware that this is an auto console variable, which means it’s automatically registered with the console variable system. Changes to the console variable will be immediately reflected in this C++ variable.
Best practices for using CVarStreamingVRAMPercentageClamp include:
- Use GetValueOnAnyThread() to safely read the value from any thread.
- If you need to modify the value, use the console variable system rather than trying to modify this variable directly.
- Be cautious about caching the value, as it can be changed at runtime. Instead, consider reading it when needed.
- Remember that this variable is part of the development and debugging toolset, so avoid relying on it for core gameplay functionality.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:299
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarStreamingVRAMPercentageClamp(
TEXT("r.Streaming.PoolSize.VRAMPercentageClamp"),
1024,
TEXT("When using PoolSizeVRAMPercentage, a maximum amout of memory to reserve in MB.\n")
TEXT("This avoids reserving too much space for systems with a lot of VRAM. (default=1024)"),
ECVF_Cheat);
void FRenderAssetStreamingSettings::Update()
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingVRAMPercentageClamp
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:298
Scope: file
Source code excerpt:
ECVF_Cheat);
static TAutoConsoleVariable<int32> CVarStreamingVRAMPercentageClamp(
TEXT("r.Streaming.PoolSize.VRAMPercentageClamp"),
1024,
TEXT("When using PoolSizeVRAMPercentage, a maximum amout of memory to reserve in MB.\n")
TEXT("This avoids reserving too much space for systems with a lot of VRAM. (default=1024)"),
ECVF_Cheat);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:329
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
bMipCalculationEnablePerLevelList = CVarStreamingMipCalculationEnablePerLevelList.GetValueOnAnyThread() != 0;
bPrioritizeMeshLODRetention = CVarPrioritizeMeshLODRetention.GetValueOnAnyThread() != 0;
VRAMPercentageClamp = CVarStreamingVRAMPercentageClamp.GetValueOnAnyThread();
MaterialQualityLevel = (int32)GetCachedScalabilityCVars().MaterialQualityLevel;
if (MinMipForSplitRequest <= 0)
{
MinMipForSplitRequest = MAX_TEXTURE_MIP_COUNT + 1;