r.SkinCache.PrintMemorySummary
r.SkinCache.PrintMemorySummary
#Overview
name: r.SkinCache.PrintMemorySummary
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Print break down of memory usage. 0: off (default), 1: print when out of memory, 2: print every frame
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkinCache.PrintMemorySummary is to control the printing of memory usage breakdown for the GPU Skin Cache system in Unreal Engine 5. This setting is primarily used for debugging and performance analysis of the skinning system.
The GPU Skin Cache system is part of the rendering subsystem in Unreal Engine, specifically dealing with the efficient rendering of skeletal meshes. It’s used to optimize the performance of skinned meshes by caching transformed vertices on the GPU.
The value of this variable is set through the console command system, as indicated by the FAutoConsoleVariableRef usage. It can be set to: 0: Off (default) 1: Print when out of memory 2: Print every frame
This variable interacts directly with its associated C++ variable GSkinCachePrintMemorySummary. They share the same value and are used interchangeably in the code.
Developers should be aware that:
- Setting this to 1 or 2 can impact performance due to the additional logging.
- It’s primarily a debugging tool and should not be enabled in release builds.
- The memory summary is logged to the “LogSkinCache” category.
Best practices when using this variable include:
- Use it temporarily for debugging memory issues related to the GPU Skin Cache.
- Be cautious about setting it to 2 (print every frame) as it can generate a lot of log data.
- Use it in conjunction with other profiling tools to get a comprehensive view of skinning performance.
Regarding the associated variable GSkinCachePrintMemorySummary: It’s an internal C++ variable that directly corresponds to the console variable. It’s used within the GPU Skin Cache implementation to control the printing of memory summaries. The code checks this variable’s value to determine when to print memory information, such as when allocation fails or at regular intervals if set to print every frame.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:180
Scope: file
Source code excerpt:
static int32 GSkinCachePrintMemorySummary = 0;
FAutoConsoleVariableRef CVarGPUSkinCachePrintMemorySummary(
TEXT("r.SkinCache.PrintMemorySummary"),
GSkinCachePrintMemorySummary,
TEXT("Print break down of memory usage.")
TEXT(" 0: off (default),")
TEXT(" 1: print when out of memory,")
TEXT(" 2: print every frame"),
ECVF_RenderThreadSafe
#Associated Variable and Callsites
This variable is associated with another variable named GSkinCachePrintMemorySummary
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:178
Scope: file
Source code excerpt:
);
static int32 GSkinCachePrintMemorySummary = 0;
FAutoConsoleVariableRef CVarGPUSkinCachePrintMemorySummary(
TEXT("r.SkinCache.PrintMemorySummary"),
GSkinCachePrintMemorySummary,
TEXT("Print break down of memory usage.")
TEXT(" 0: off (default),")
TEXT(" 1: print when out of memory,")
TEXT(" 2: print every frame"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:1757
Scope (from outer to inner):
file
function bool FGPUSkinCache::ProcessEntry
Source code excerpt:
if (!NewPositionAllocation)
{
if (GSkinCachePrintMemorySummary > 0)
{
const FString RayTracingTag = (Mode == EGPUSkinCacheEntryMode::RayTracing ? TEXT("[RT]") : TEXT(""));
uint64 RequiredMemInBytes = FRWBuffersAllocation::CalculateRequiredMemory(TotalNumVertices, WithTangents, bEntryUseIntermediateTangents, InterAccumTangentBufferSize);
UE_LOG(LogSkinCache, Warning, TEXT("FGPUSkinCache::ProcessEntry%s failed to allocate %.3fMB for mesh %s LOD%d, extra required memory increased to %.3fMB"),
*RayTracingTag, RequiredMemInBytes / MBSize, *GetSkeletalMeshObjectName(Skin), LODIndex, ExtraRequiredMemory / MBSize);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:2370
Scope (from outer to inner):
file
function uint64 FGPUSkinCache::GetExtraRequiredMemoryAndReset
Source code excerpt:
uint64 FGPUSkinCache::GetExtraRequiredMemoryAndReset()
{
if (GSkinCachePrintMemorySummary == 2 || (GSkinCachePrintMemorySummary == 1 && ExtraRequiredMemory > 0))
{
PrintMemorySummary();
}
uint64 OriginalValue = ExtraRequiredMemory;
ExtraRequiredMemory = 0;