r.Streaming.PoolSizeForMeshes

r.Streaming.PoolSizeForMeshes

#Overview

name: r.Streaming.PoolSizeForMeshes

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Streaming.PoolSizeForMeshes is to control the size of the memory pool dedicated to streaming meshes in Unreal Engine 5. This setting variable is part of the engine’s streaming system, which manages the loading and unloading of assets (in this case, meshes) to optimize memory usage and performance.

This setting variable is primarily used by the Unreal Engine’s streaming subsystem, specifically within the texture and mesh streaming components. Based on the callsites, it’s clear that this variable is utilized in the Engine module, particularly in the streaming-related code.

The value of this variable is set through the console variable system (CVarStreamingPoolSizeForMeshes). It can be modified at runtime or set in configuration files.

The associated variable CVarStreamingPoolSizeForMeshes directly interacts with r.Streaming.PoolSizeForMeshes, as they share the same value. This variable is used to retrieve the current value of the setting in the engine’s code.

Developers must be aware of the following when using this variable:

  1. A value less than 0 means that meshes and textures will share the same streaming pool.
  2. A value of 0 or greater specifies the size of the pool dedicated to meshes in bytes.
  3. This setting can affect performance and memory usage, especially on platforms with limited resources.

Best practices when using this variable include:

  1. Carefully consider the balance between mesh and texture streaming pool sizes based on your game’s asset composition.
  2. Monitor performance and memory usage when adjusting this value to find the optimal setting for your specific use case.
  3. Be aware that this setting may need to be adjusted differently for various platforms or hardware configurations.
  4. Use in conjunction with other streaming-related settings for optimal results.

Regarding the associated variable CVarStreamingPoolSizeForMeshes: This is an internal console variable used to access and modify the r.Streaming.PoolSizeForMeshes setting. It’s implemented as a TAutoConsoleVariable, which allows for runtime modification and retrieval of the value. The engine uses this variable to update the streaming settings in the FRenderAssetStreamingSettings::Update() function. Developers should generally interact with the r.Streaming.PoolSizeForMeshes console command rather than directly manipulating this variable in code.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:66, section: [Mobile DeviceProfile]

#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:113

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarStreamingPoolSizeForMeshes(
	TEXT("r.Streaming.PoolSizeForMeshes"),
	-1,
	TEXT("< 0: Mesh and texture share the same pool, otherwise the size of pool dedicated to meshes."),
	ECVF_Scalability | ECVF_ExcludeFromPreview);

TAutoConsoleVariable<int32> CVarStreamingMaxTempMemoryAllowed(
	TEXT("r.Streaming.MaxTempMemoryAllowed"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarStreamingPoolSizeForMeshes. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:112

Scope: file

Source code excerpt:

	ECVF_Scalability | ECVF_ExcludeFromPreview);

static TAutoConsoleVariable<int32> CVarStreamingPoolSizeForMeshes(
	TEXT("r.Streaming.PoolSizeForMeshes"),
	-1,
	TEXT("< 0: Mesh and texture share the same pool, otherwise the size of pool dedicated to meshes."),
	ECVF_Scalability | ECVF_ExcludeFromPreview);

TAutoConsoleVariable<int32> CVarStreamingMaxTempMemoryAllowed(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:312

Scope (from outer to inner):

file
function     void FRenderAssetStreamingSettings::Update

Source code excerpt:

	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;
	bUseAllMips = CVarStreamingUseAllMips.GetValueOnAnyThread() != 0;