r.SkinCache.Allow
r.SkinCache.Allow
#Overview
name: r.SkinCache.Allow
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether or not to allow the GPU skin Cache system to be enabled.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkinCache.Allow is to control whether the GPU skin cache system can be enabled in Unreal Engine 5. This setting variable is primarily used for the rendering system, specifically for GPU-based character skinning optimization.
The Unreal Engine subsystem that relies on this setting variable is the rendering system, particularly the GPU skin cache component. It is referenced in the Engine and RenderCore modules.
The value of this variable is set as a console variable (CVar) in the engine’s configuration. It is initialized with a default value of true, allowing the GPU skin cache system to be enabled by default.
This variable interacts with other skinning-related variables and functions, such as AreSkinCacheShadersEnabled. The IsGPUSkinCacheAvailable function checks both r.SkinCache.Allow and whether skin cache shaders are enabled to determine if the GPU skin cache can be used.
Developers must be aware that this variable is marked as read-only and render thread safe. This means that its value should not be changed during runtime, and it’s intended to be set before the rendering process begins.
Best practices when using this variable include:
- Consider the target platforms and their GPU capabilities when deciding whether to enable or disable the GPU skin cache.
- Use this variable in conjunction with other skinning-related settings to fine-tune performance for character-heavy scenes.
- Be aware that changing this setting may require recompilation of shaders or restarting the engine to take effect.
- Test performance with and without the GPU skin cache enabled to determine the optimal setting for your specific project.
- Keep in mind that this setting is a global option and will affect all instances where GPU skinning is used in the project.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:69
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarAllowGPUSkinCache(
TEXT("r.SkinCache.Allow"),
true,
TEXT("Whether or not to allow the GPU skin Cache system to be enabled.\n"),
ECVF_RenderThreadSafe | ECVF_ReadOnly
);
static FAutoConsoleVariableRef CVarEnableGPUSkinCacheShaders(
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderUtils.cpp:1432
Scope (from outer to inner):
file
function bool IsGPUSkinCacheAllowed
Source code excerpt:
RENDERCORE_API bool IsGPUSkinCacheAllowed(EShaderPlatform Platform)
{
static FShaderPlatformCachedIniValue<bool> PerPlatformCVar(TEXT("r.SkinCache.Allow"));
return PerPlatformCVar.Get(Platform);
}
RENDERCORE_API bool IsGPUSkinCacheAvailable(EShaderPlatform Platform)
{
return AreSkinCacheShadersEnabled(Platform) != 0 && IsGPUSkinCacheAllowed(Platform);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Public/RenderUtils.h:477
Scope: file
Source code excerpt:
/**
* Checks if skin cache shaders are allowed for the platform (via r.SkinCache.Allow)
*/
RENDERCORE_API bool IsGPUSkinCacheAllowed(EShaderPlatform Platform);
/**
* Can the skin cache be used (ie shaders added, etc)
*/
RENDERCORE_API bool IsGPUSkinCacheAvailable(EShaderPlatform Platform);