r.Streaming.UseFixedPoolSize
r.Streaming.UseFixedPoolSize
#Overview
name: r.Streaming.UseFixedPoolSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If non-zero, do not allow the pool size to change at run time.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.UseFixedPoolSize is to control whether the texture streaming pool size can be dynamically adjusted at runtime or if it should remain fixed. This setting is primarily used for the texture streaming system in Unreal Engine 5.
The Unreal Engine subsystem that relies on this setting variable is the texture streaming system, which is part of the rendering module. It’s specifically used in the FRenderAssetStreamingManager class, which manages the streaming of render assets, including textures.
The value of this variable is set through the console variable system. It can be modified in-game using console commands, or programmatically using the IConsoleManager interface.
This variable interacts closely with another variable named CVarStreamingPoolSize, which determines the actual size of the texture streaming pool. When r.Streaming.UseFixedPoolSize is set to a non-zero value, it prevents the texture streaming system from dynamically adjusting the pool size based on runtime conditions.
Developers must be aware that setting this variable to a non-zero value can impact the engine’s ability to adapt to different memory conditions at runtime. This could potentially lead to suboptimal memory usage or performance in certain scenarios.
Best practices when using this variable include:
- Leave it at its default value (0) unless there’s a specific need for a fixed pool size.
- If using a fixed pool size, ensure that the CVarStreamingPoolSize is set to an appropriate value for your target hardware.
- Be cautious when modifying this setting during gameplay, as it can affect performance and memory usage.
Regarding the associated variable CVarStreamingUseFixedPoolSize:
The purpose of CVarStreamingUseFixedPoolSize is essentially the same as r.Streaming.UseFixedPoolSize. It’s an internal representation of the console variable within the engine’s C++ code.
This variable is used directly in the FRenderAssetStreamingManager::CheckUserSettings() function to determine whether the texture pool size should be adjusted based on user settings or system memory.
The value of CVarStreamingUseFixedPoolSize is set automatically by the console variable system when r.Streaming.UseFixedPoolSize is modified.
CVarStreamingUseFixedPoolSize interacts closely with CVarStreamingPoolSize, which represents the r.Streaming.PoolSize console variable.
Developers should be aware that this variable is used internally by the engine and should generally not be modified directly in code. Instead, they should use the r.Streaming.UseFixedPoolSize console variable to control this setting.
Best practices for CVarStreamingUseFixedPoolSize are the same as for r.Streaming.UseFixedPoolSize, as they represent the same setting.
#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:101
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarStreamingUseFixedPoolSize(
TEXT("r.Streaming.UseFixedPoolSize"),
0,
TEXT("If non-zero, do not allow the pool size to change at run time."),
ECVF_Scalability);
TAutoConsoleVariable<int32> CVarStreamingPoolSize(
TEXT("r.Streaming.PoolSize"),
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:413
Scope (from outer to inner):
file
function void FInEditorCapture::Start
Source code excerpt:
}
IConsoleVariable* CVarUseFixedPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.UseFixedPoolSize"));
if (CVarUseFixedPoolSize)
{
BackedUpUseFixedPoolSize = CVarUseFixedPoolSize->GetInt();
CVarUseFixedPoolSize->Set(0, ECVF_SetByConsole);
}
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:576
Scope (from outer to inner):
file
function void FInEditorCapture::Shutdown
Source code excerpt:
}
IConsoleVariable* CVarUseFixedPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.UseFixedPoolSize"));
if (CVarUseFixedPoolSize)
{
CVarUseFixedPoolSize->Set(BackedUpUseFixedPoolSize, ECVF_SetByConsole);
}
IConsoleVariable* CVarTextureStreaming = IConsoleManager::Get().FindConsoleVariable(TEXT("r.TextureStreaming"));
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingUseFixedPoolSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:1593
Scope (from outer to inner):
file
function void FRenderAssetStreamingManager::CheckUserSettings
Source code excerpt:
void FRenderAssetStreamingManager::CheckUserSettings()
{
if (CVarStreamingUseFixedPoolSize.GetValueOnGameThread() == 0)
{
const int32 PoolSizeSetting = CVarStreamingPoolSize.GetValueOnGameThread();
int64 TexturePoolSize = GTexturePoolSize;
if (PoolSizeSetting == -1)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:100
Scope: file
Source code excerpt:
#endif
TAutoConsoleVariable<int32> CVarStreamingUseFixedPoolSize(
TEXT("r.Streaming.UseFixedPoolSize"),
0,
TEXT("If non-zero, do not allow the pool size to change at run time."),
ECVF_Scalability);
TAutoConsoleVariable<int32> CVarStreamingPoolSize(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.h:59
Scope: file
Source code excerpt:
extern TAutoConsoleVariable<float> CVarStreamingBoost;
extern TAutoConsoleVariable<float> CVarStreamingMinBoost;
extern TAutoConsoleVariable<int32> CVarStreamingUseFixedPoolSize;
extern TAutoConsoleVariable<int32> CVarStreamingPoolSize;
extern TAutoConsoleVariable<int32> CVarStreamingCheckBuildStatus;
extern TAutoConsoleVariable<int32> CVarStreamingUseMaterialData;
extern TAutoConsoleVariable<int32> CVarStreamingNumStaticComponentsProcessedPerFrame;
extern TAutoConsoleVariable<int32> CVarStreamingDefragDynamicBounds;
extern TAutoConsoleVariable<float> CVarStreamingMaxTextureUVDensity;