r.SkinCache.Debug
r.SkinCache.Debug
#Overview
name: r.SkinCache.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
A scaling constant passed to the SkinCache shader, useful for debugging
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkinCache.Debug is to provide a scaling constant for the GPU Skin Cache shader, which is useful for debugging purposes in the rendering system.
This setting variable is primarily used within the GPU Skin Cache subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s evident that this variable is utilized in the Engine’s runtime, specifically in the GPUSkinCache.cpp file.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1.0f and can be modified at runtime via console commands or through engine configuration files.
The associated variable CVarGPUSkinCacheDebug interacts directly with r.SkinCache.Debug. They share the same value, and CVarGPUSkinCacheDebug is used to access the value of r.SkinCache.Debug within the C++ code.
Developers should be aware that this variable is render thread safe (ECVF_RenderThreadSafe), meaning it can be safely accessed and modified from the render thread without causing race conditions or other threading issues.
Best practices when using this variable include:
- Use it primarily for debugging purposes, as intended.
- Be cautious when modifying its value, as it directly affects the skin cache shader’s behavior.
- Remember that changes to this value will impact performance and visual output, so it should be used judiciously in production environments.
Regarding the associated variable CVarGPUSkinCacheDebug:
The purpose of CVarGPUSkinCacheDebug is to provide a programmatic interface to access and modify the r.SkinCache.Debug value within the C++ code of the engine.
It’s used in the GPU Skin Cache system of the rendering module, specifically in the SetParameters function where it’s passed to the shader.
The value of CVarGPUSkinCacheDebug is set through the console variable system and is directly linked to r.SkinCache.Debug.
This variable interacts closely with the shader code, as it’s used to set a shader parameter (SkinCacheDebug) in the SetParameters function.
Developers should be aware that changes to CVarGPUSkinCacheDebug will immediately affect the behavior of the skin cache shader. It’s accessed using the GetValueOnRenderThread() method, ensuring thread-safe access in the render thread.
Best practices for using CVarGPUSkinCacheDebug include:
- Use it for fine-tuning and debugging the skin cache shader.
- Be mindful of performance implications when modifying its value.
- Ensure any modifications are properly reverted after debugging to maintain expected behavior in production builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:137
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarGPUSkinCacheDebug(
TEXT("r.SkinCache.Debug"),
1.0f,
TEXT("A scaling constant passed to the SkinCache shader, useful for debugging"),
ECVF_RenderThreadSafe
);
static float GSkinCacheSceneMemoryLimitInMB = 128.0f;
#Associated Variable and Callsites
This variable is associated with another variable named CVarGPUSkinCacheDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:136
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarGPUSkinCacheDebug(
TEXT("r.SkinCache.Debug"),
1.0f,
TEXT("A scaling constant passed to the SkinCache shader, useful for debugging"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:700
Scope (from outer to inner):
file
function void SetParameters
Source code excerpt:
}
SetShaderValue(BatchedParameters, SkinCacheDebug, CVarGPUSkinCacheDebug.GetValueOnRenderThread());
}
void UnsetParameters(FRHIBatchedShaderUnbinds& BatchedUnbinds)
{
UnsetUAVParameter(BatchedUnbinds, PositionBufferUAV);
UnsetUAVParameter(BatchedUnbinds, TangentBufferUAV);