ShowFlag.VisualizeGPUSkinCache
ShowFlag.VisualizeGPUSkinCache
#Overview
name: ShowFlag.VisualizeGPUSkinCache
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.VisualizeGPUSkinCache is to enable the visualization of the GPU Skin Cache in Unreal Engine 5. This setting is primarily used for debugging and performance analysis of the character animation system, specifically the GPU-based skin cache implementation.
This setting variable is primarily used in the rendering subsystem of Unreal Engine 5. Based on the callsites, it’s clear that it interacts with the following modules:
- Engine module (SceneView.cpp, ShowFlags.cpp)
- Renderer module (DebugViewModeRendering.cpp, PostProcessing.cpp, SceneRendering.cpp)
The value of this variable is set through the engine show flags system, which allows developers to toggle various debug visualization options. It’s defined in the ShowFlagsValues.inl file with the SHOWFLAG_FIXED_IN_SHIPPING macro, indicating that it’s not available in shipping builds.
The associated variable VisualizeGPUSkinCache interacts closely with ShowFlag.VisualizeGPUSkinCache. They are used interchangeably in the code to check if the GPU Skin Cache visualization is enabled.
Developers should be aware of the following when using this variable:
- It’s a debug visualization tool, not meant for use in shipping builds.
- Enabling this flag will change the rendering pipeline to display the GPU Skin Cache visualization instead of the normal scene rendering.
- It may have performance implications when enabled, as it adds additional rendering passes.
Best practices for using this variable include:
- Use it only during development and debugging phases, not in production builds.
- Combine it with other debugging tools and profilers to get a comprehensive view of GPU Skin Cache performance.
- Be aware that it may affect other rendering features or debug visualizations when enabled.
Regarding the associated variable VisualizeGPUSkinCache:
The purpose of VisualizeGPUSkinCache is the same as ShowFlag.VisualizeGPUSkinCache. It’s used interchangeably in the code to check if the GPU Skin Cache visualization is enabled.
This variable is used in the same subsystems and modules as ShowFlag.VisualizeGPUSkinCache, primarily in the rendering pipeline.
The value of this variable is typically set based on the ShowFlag.VisualizeGPUSkinCache value, as they are closely associated.
Developers should treat VisualizeGPUSkinCache the same way as ShowFlag.VisualizeGPUSkinCache, following the same best practices and being aware of the same considerations when using it for debugging and performance analysis.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:449
Scope: file
Source code excerpt:
/** Visualize Skin Cache */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeGPUSkinCache, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeGPUSkinCache", "Visualize GPU Skin Cache"))
/** Enables ShaderPrint functionality that is used for debug printing from shaders (e.g. 'Nanitestats' command). Disable this for certain editor rendering (e.g. thumbnail rendering) */
SHOWFLAG_ALWAYS_ACCESSIBLE(ShaderPrint, SFG_Developer, NSLOCTEXT("UnrealEd", "ShaderPrint", "Shader Print"))
#undef SHOWFLAG_ALWAYS_ACCESSIBLE
#undef SHOWFLAG_FIXED_IN_SHIPPING
#Associated Variable and Callsites
This variable is associated with another variable named VisualizeGPUSkinCache
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:3099
Scope: file
Source code excerpt:
return DVSM_LODColoration;
}
else if (EngineShowFlags.VisualizeGPUSkinCache)
{
return DVSM_VisualizeGPUSkinCache;
}
return DVSM_None;
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:826
Scope: file
Source code excerpt:
return VMI_RayTracingDebug;
}
else if (EngineShowFlags.VisualizeGPUSkinCache)
{
return VMI_VisualizeGPUSkinCache;
}
return EngineShowFlags.Lighting ? VMI_Lit : VMI_Unlit;
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:449
Scope: file
Source code excerpt:
/** Visualize Skin Cache */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeGPUSkinCache, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeGPUSkinCache", "Visualize GPU Skin Cache"))
/** Enables ShaderPrint functionality that is used for debug printing from shaders (e.g. 'Nanitestats' command). Disable this for certain editor rendering (e.g. thumbnail rendering) */
SHOWFLAG_ALWAYS_ACCESSIBLE(ShaderPrint, SFG_Developer, NSLOCTEXT("UnrealEd", "ShaderPrint", "Shader Print"))
#undef SHOWFLAG_ALWAYS_ACCESSIBLE
#undef SHOWFLAG_FIXED_IN_SHIPPING
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugViewModeRendering.cpp:408
Scope (from outer to inner):
file
function void FDebugViewModeMeshProcessor::AddMeshBatch
Source code excerpt:
ViewIfDynamicMeshCommand ? ViewIfDynamicMeshCommand->ViewMatrices.GetViewOrigin() : FVector::ZeroVector,
(ViewIfDynamicMeshCommand && ViewIfDynamicMeshCommand->Family->EngineShowFlags.HLODColoration) ? MeshBatch.VisualizeHLODIndex : MeshBatch.VisualizeLODIndex,
(ViewIfDynamicMeshCommand && ViewIfDynamicMeshCommand->Family->EngineShowFlags.VisualizeGPUSkinCache) ? MeshBatch.Elements[0].SkinCacheDebugColor : FColor::White,
ViewModeParam,
ViewModeParamName);
// Shadermap can be null while shaders are compiling.
UpdateInstructionCount(ShaderElementData, BatchMaterial, VertexFactoryType);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1816
Scope (from outer to inner):
file
function void AddDebugViewPostProcessingPasses
Source code excerpt:
// Some view modes do not actually output a color so they should not be tonemapped.
const bool bTonemapAfter = View.Family->EngineShowFlags.RayTracingDebug || View.Family->EngineShowFlags.VisualizeGPUSkinCache;
const bool bTonemapBefore = !bTonemapAfter && !View.Family->EngineShowFlags.ShaderComplexity;
const bool bViewFamilyOutputInHDR = View.Family->RenderTarget->GetSceneHDREnabled();
enum class EPass : uint32
{
Visualize,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:4793
Scope (from outer to inner):
file
function static void RenderViewFamilies_RenderThread
Source code excerpt:
// Only run visualization update once, but set debug flags for all view families if the mode is active
// Note VisualizationData.Update needs to be called per frame, as || lazy evaluation is used, so need to do it before evaluating VisualizeGPUSkinCache flag
if (bUpdatedGPUSkinCacheVisualization || VisualizationData.Update(View.CurrentGPUSkinCacheVisualizationMode) || ViewFamily.EngineShowFlags.VisualizeGPUSkinCache)
{
// When activating visualization from the command line, enable VisualizeGPUSkinCache.
ViewFamily.EngineShowFlags.SetVisualizeGPUSkinCache(true);
ViewFamily.DebugViewShaderMode = DVSM_VisualizeGPUSkinCache;
// Only draw the visualization info text once.
if (!bUpdatedGPUSkinCacheVisualization)
{