r.Streaming.PoolSize
r.Streaming.PoolSize
#Overview
name: r.Streaming.PoolSize
The value of this variable can be defined or overridden in .ini config files. 7
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
-1: Default texture pool size, otherwise the size in MB
It is referenced in 12
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.PoolSize is to control the size of the texture streaming pool in Unreal Engine 5. This setting variable is primarily used for the rendering system, specifically for texture streaming management.
-
The r.Streaming.PoolSize variable is used by various Unreal Engine subsystems, including the texture streaming manager, rendering hardware interface (RHI) implementations for different graphics APIs (Metal, OpenGL, Vulkan), and the movie scene capture system.
-
The value of this variable is set through the console variable system. It can be modified at runtime or set in configuration files. The default value is -1, which means the engine will use a default texture pool size.
-
This variable interacts with several other variables, including:
- r.Streaming.UseFixedPoolSize
- r.Streaming.PoolSizeForMeshes
- r.Streaming.LimitPoolSizeToVRAM
-
Developers should be aware that:
- Setting this value to -1 allows the engine to determine the appropriate pool size automatically.
- The value is in megabytes when set to a positive number.
- This setting affects memory usage and can impact performance and texture streaming behavior.
-
Best practices when using this variable:
- Leave it at -1 unless you have specific performance requirements or memory constraints.
- When adjusting, monitor performance and memory usage to find the optimal value for your project.
- Consider platform-specific requirements when setting this value.
Regarding the associated variable CVarStreamingPoolSize:
The purpose of CVarStreamingPoolSize is to provide programmatic access to the r.Streaming.PoolSize setting within the engine’s C++ code. It’s used internally by various engine systems to read and modify the texture streaming pool size.
-
This variable is used in the texture streaming manager, movie scene capture system, and other parts of the engine that need to interact with the texture streaming pool size.
-
The value of CVarStreamingPoolSize is typically set and retrieved using the console variable system’s API.
-
It interacts closely with r.Streaming.PoolSize, effectively serving as its C++ representation within the engine code.
-
Developers working on engine-level code should be aware that:
- Changes to CVarStreamingPoolSize will affect the r.Streaming.PoolSize setting.
- The variable provides type-safe access to the pool size value.
-
Best practices when using CVarStreamingPoolSize in C++ code:
- Use the appropriate console variable API functions to read or modify its value.
- Consider the impact on performance and memory usage when changing this value.
- Ensure thread-safety when accessing this variable in multi-threaded contexts.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:563, section: [TextureQuality@0]
- INI Section:
TextureQuality@0
- Raw value:
400
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:574, section: [TextureQuality@1]
- INI Section:
TextureQuality@1
- Raw value:
600
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:585, section: [TextureQuality@2]
- INI Section:
TextureQuality@2
- Raw value:
800
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:596, section: [TextureQuality@3]
- INI Section:
TextureQuality@3
- Raw value:
1000
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:607, section: [TextureQuality@Cine]
- INI Section:
TextureQuality@Cine
- Raw value:
3000
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:112, section: [IOS_Mid DeviceProfile]
- INI Section:
IOS_Mid DeviceProfile
- Raw value:
85
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:525, section: [Android_Mid DeviceProfile]
- INI Section:
Android_Mid DeviceProfile
- Raw value:
85
- Is Array:
False
#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:107
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarStreamingPoolSize(
TEXT("r.Streaming.PoolSize"),
-1,
TEXT("-1: Default texture pool size, otherwise the size in MB"),
ECVF_Scalability | ECVF_ExcludeFromPreview);
static TAutoConsoleVariable<int32> CVarStreamingPoolSizeForMeshes(
TEXT("r.Streaming.PoolSizeForMeshes"),
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:406
Scope (from outer to inner):
file
function void FInEditorCapture::Start
Source code excerpt:
{
const int32 UndefinedTexturePoolSize = -1;
IConsoleVariable* CVarStreamingPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.PoolSize"));
if (CVarStreamingPoolSize)
{
BackedUpStreamingPoolSize = CVarStreamingPoolSize->GetInt();
CVarStreamingPoolSize->Set(UndefinedTexturePoolSize, ECVF_SetByConsole);
}
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:570
Scope (from outer to inner):
file
function void FInEditorCapture::Shutdown
Source code excerpt:
if (!CaptureObject->Settings.bEnableTextureStreaming)
{
IConsoleVariable* CVarStreamingPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.PoolSize"));
if (CVarStreamingPoolSize)
{
CVarStreamingPoolSize->Set(BackedUpStreamingPoolSize, ECVF_SetByConsole);
}
IConsoleVariable* CVarUseFixedPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.UseFixedPoolSize"));
#Loc: <Workspace>/Engine/Source/Runtime/Apple/MetalRHI/Private/MetalRHI.cpp:542
Scope: file
Source code excerpt:
else
{
static const auto CVarStreamingTexturePoolSize = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Streaming.PoolSize"));
GTexturePoolSize = (int64)CVarStreamingTexturePoolSize->GetValueOnAnyThread() * 1024 * 1024;
UE_LOG(LogRHI,Log,TEXT("Texture pool is %llu MB (of %llu MB total graphics mem)"),
GTexturePoolSize / 1024 / 1024,
MemoryStats.TotalGraphicsMemory / 1024 / 1024);
}
#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/OpenGLDevice.cpp:1487
Scope (from outer to inner):
file
function void FOpenGLDynamicRHI::Init
Source code excerpt:
#else
static const auto CVarStreamingTexturePoolSize = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Streaming.PoolSize"));
GTexturePoolSize = (int64)CVarStreamingTexturePoolSize->GetValueOnAnyThread() * 1024 * 1024;
UE_LOG(LogRHI,Log,TEXT("Texture pool is %llu MB (of %llu MB total graphics mem)"),
GTexturePoolSize / 1024 / 1024,
FOpenGL::GetVideoMemorySize());
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRHI.cpp:546
Scope (from outer to inner):
file
function void FVulkanDynamicRHI::Init
Source code excerpt:
bIsStandaloneStereoDevice = IHeadMountedDisplayModule::IsAvailable() && IHeadMountedDisplayModule::Get().IsStandaloneStereoOnlyDevice();
static const auto CVarStreamingTexturePoolSize = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Streaming.PoolSize"));
int32 StreamingPoolSizeValue = CVarStreamingTexturePoolSize->GetValueOnAnyThread();
if (GPoolSizeVRAMPercentage > 0)
{
const uint64 TotalGPUMemory = Device->GetDeviceMemoryManager().GetTotalMemory(true);
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingPoolSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:406
Scope (from outer to inner):
file
function void FInEditorCapture::Start
Source code excerpt:
{
const int32 UndefinedTexturePoolSize = -1;
IConsoleVariable* CVarStreamingPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.PoolSize"));
if (CVarStreamingPoolSize)
{
BackedUpStreamingPoolSize = CVarStreamingPoolSize->GetInt();
CVarStreamingPoolSize->Set(UndefinedTexturePoolSize, ECVF_SetByConsole);
}
IConsoleVariable* CVarUseFixedPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.UseFixedPoolSize"));
if (CVarUseFixedPoolSize)
{
BackedUpUseFixedPoolSize = CVarUseFixedPoolSize->GetInt();
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:570
Scope (from outer to inner):
file
function void FInEditorCapture::Shutdown
Source code excerpt:
if (!CaptureObject->Settings.bEnableTextureStreaming)
{
IConsoleVariable* CVarStreamingPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.PoolSize"));
if (CVarStreamingPoolSize)
{
CVarStreamingPoolSize->Set(BackedUpStreamingPoolSize, ECVF_SetByConsole);
}
IConsoleVariable* CVarUseFixedPoolSize = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streaming.UseFixedPoolSize"));
if (CVarUseFixedPoolSize)
{
CVarUseFixedPoolSize->Set(BackedUpUseFixedPoolSize, ECVF_SetByConsole);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:1595
Scope (from outer to inner):
file
function void FRenderAssetStreamingManager::CheckUserSettings
Source code excerpt:
if (CVarStreamingUseFixedPoolSize.GetValueOnGameThread() == 0)
{
const int32 PoolSizeSetting = CVarStreamingPoolSize.GetValueOnGameThread();
int64 TexturePoolSize = GTexturePoolSize;
if (PoolSizeSetting == -1)
{
FTextureMemoryStats Stats;
RHIGetTextureMemoryStats(Stats);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:106
Scope: file
Source code excerpt:
ECVF_Scalability);
TAutoConsoleVariable<int32> CVarStreamingPoolSize(
TEXT("r.Streaming.PoolSize"),
-1,
TEXT("-1: Default texture pool size, otherwise the size in MB"),
ECVF_Scalability | ECVF_ExcludeFromPreview);
static TAutoConsoleVariable<int32> CVarStreamingPoolSizeForMeshes(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:311
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
HLODStrategy = CVarStreamingHLODStrategy.GetValueOnAnyThread();
GlobalMipBias = !GIsEditor ? FMath::FloorToInt(FMath::Max<float>(0.f, CVarStreamingMipBias.GetValueOnAnyThread())) : 0;
PoolSize = CVarStreamingPoolSize.GetValueOnAnyThread();
MeshPoolSize = CVarStreamingPoolSizeForMeshes.GetValueOnAnyThread();
bUsePerTextureBias = CVarStreamingUsePerTextureBias.GetValueOnAnyThread() != 0;
bUseNewMetrics = CVarStreamingUseNewMetrics.GetValueOnAnyThread() != 0;
bLimitPoolSizeToVRAM = !GIsEditor && CVarStreamingLimitPoolSizeToVRAM.GetValueOnAnyThread() != 0;
bFullyLoadUsedTextures = CVarStreamingFullyLoadUsedTextures.GetValueOnAnyThread() != 0;
bFullyLoadMeshes = CVarStreamingFullyLoadMeshes.GetValueOnAnyThread() != 0;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.h:60
Scope: file
Source code excerpt:
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;
extern TAutoConsoleVariable<int32> CVarStreamingLowResHandlingMode;