r.RenderTargetPoolMin
r.RenderTargetPoolMin
#Overview
name: r.RenderTargetPoolMin
The value of this variable can be defined or overridden in .ini config files. 14
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If the render target pool size (in MB) is below this number there is no deallocation of rendertargetsDefault is 200 MB.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RenderTargetPoolMin is to set a minimum size for the render target pool in megabytes. It acts as a threshold below which no deallocation of render targets occurs.
This setting variable is primarily used by the rendering system in Unreal Engine 5. Based on the callsites, it’s utilized in the RenderCore module, specifically within the render target pool management system.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable in the ConsoleManager.cpp file with a default value of 400 MB.
The r.RenderTargetPoolMin variable interacts with the render target pool allocation system. It’s used in the FRenderTargetPool::TickPoolElements function to determine the minimum pool size before deallocation occurs.
Developers should be aware that this variable affects memory management for render targets. Setting it too high might prevent necessary deallocations and lead to higher memory usage, while setting it too low might cause frequent allocations and deallocations, potentially impacting performance.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Monitoring memory usage and performance to find the optimal value.
- Considering the trade-off between memory usage and potential performance impact from frequent allocations/deallocations.
- Using it in conjunction with other render target pool management settings for a comprehensive optimization strategy.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:396, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
300
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:416, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
350
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:449, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
400
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:484, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
400
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:522, section: [PostProcessQuality@Cine]
- INI Section:
PostProcessQuality@Cine
- Raw value:
1000
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:63, section: [Mobile DeviceProfile]
- INI Section:
Mobile DeviceProfile
- Raw value:
150
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:95, section: [IOS_Low DeviceProfile]
- INI Section:
IOS_Low DeviceProfile
- Raw value:
75
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:109, section: [IOS_Mid DeviceProfile]
- INI Section:
IOS_Mid DeviceProfile
- Raw value:
100
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:136, section: [IOS_High DeviceProfile]
- INI Section:
IOS_High DeviceProfile
- Raw value:
150
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:153, section: [IOS_Epic DeviceProfile]
- INI Section:
IOS_Epic DeviceProfile
- Raw value:
200
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:508, section: [Android_Low DeviceProfile]
- INI Section:
Android_Low DeviceProfile
- Raw value:
75
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:522, section: [Android_Mid DeviceProfile]
- INI Section:
Android_Mid DeviceProfile
- Raw value:
100
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:549, section: [Android_High DeviceProfile]
- INI Section:
Android_High DeviceProfile
- Raw value:
150
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:565, section: [Android_Epic DeviceProfile]
- INI Section:
Android_Epic DeviceProfile
- Raw value:
200
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3822
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRenderTargetPoolMin(
TEXT("r.RenderTargetPoolMin"),
400,
TEXT("If the render target pool size (in MB) is below this number there is no deallocation of rendertargets"
"Default is 200 MB."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarIdleWhenNotForeground(
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderTargetPool.cpp:271
Scope (from outer to inner):
file
function void FRenderTargetPool::TickPoolElements
Source code excerpt:
uint32 MinimumPoolSizeInKB;
{
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.RenderTargetPoolMin"));
MinimumPoolSizeInKB = FMath::Clamp(CVar->GetValueOnRenderThread(), 0, 2000) * 1024;
}
CompactPool();
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Public/RenderTargetPool.h:165
Scope (from outer to inner):
file
class class FRenderTargetPool : public FRenderResource
Source code excerpt:
TArray< TRefCountPtr<FPooledRenderTarget> > DeferredDeleteArray;
// redundant, can always be computed with GetStats(), to debug "out of memory" situations and used for r.RenderTargetPoolMin
uint32 AllocationLevelInKB = 0;
// to avoid log spam
bool bCurrentlyOverBudget = false;
// could be done on the fly but that makes the RenderTargetPoolEvents harder to read