GeometryCache.Codec.Debug
GeometryCache.Codec.Debug
#Overview
name: GeometryCache.Codec.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables debug logging for the codec.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of GeometryCache.Codec.Debug is to enable debug logging for the Geometry Cache codec in Unreal Engine 5. This setting variable is primarily used for debugging and performance analysis of the Geometry Cache system, which is part of the runtime geometry animation functionality.
This setting variable is utilized by the GeometryCache plugin, specifically within the codec implementation for version 1 (CodecV1). The GeometryCache plugin is responsible for handling efficient storage and playback of pre-computed geometry animations.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable
The associated variable CVarCodecDebug directly interacts with GeometryCache.Codec.Debug. They share the same value and purpose, with CVarCodecDebug being the C++ representation of the console variable.
Developers must be aware that enabling this debug logging may impact performance, especially in production builds. It should primarily be used during development and debugging phases.
Best practices when using this variable include:
- Only enable it when actively debugging Geometry Cache codec issues.
- Disable it in production builds to avoid performance overhead.
- Use it in conjunction with other debugging tools to get a comprehensive view of the Geometry Cache system’s behavior.
Regarding the associated variable CVarCodecDebug:
CVarCodecDebug is the C++ variable that directly corresponds to the GeometryCache.Codec.Debug console variable. It is used within the code to check if debug logging should be enabled.
The variable is defined using the TAutoConsoleVariable template, which automatically registers it with the console variable system. It is set up with the following properties:
- Type: int32
- Default value: 0
- Description: “Enables debug logging for the codec.”
- Flags: ECVF_Scalability | ECVF_RenderThreadSafe
In the code, CVarCodecDebug is used to conditionally log debugging information. For example, it’s checked in the DecodeFrameData function to log frame decoding performance when enabled.
Developers should use CVarCodecDebug.GetValueOnAnyThread() to safely retrieve the current value of the debug setting in their code, ensuring thread-safe access to the variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/CodecV1.cpp:27
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarCodecDebug(
TEXT("GeometryCache.Codec.Debug"),
0,
TEXT("Enables debug logging for the codec."),
ECVF_Scalability | ECVF_RenderThreadSafe);
DEFINE_LOG_CATEGORY(LogGeoCaStreamingCodecV1);
#Associated Variable and Callsites
This variable is associated with another variable named CVarCodecDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/CodecV1.cpp:26
Scope: file
Source code excerpt:
*/
static TAutoConsoleVariable<int32> CVarCodecDebug(
TEXT("GeometryCache.Codec.Debug"),
0,
TEXT("Enables debug logging for the codec."),
ECVF_Scalability | ECVF_RenderThreadSafe);
DEFINE_LOG_CATEGORY(LogGeoCaStreamingCodecV1);
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/CodecV1.cpp:1293
Scope (from outer to inner):
file
function bool FCodecV1Decoder::DecodeFrameData
Source code excerpt:
});
if (CVarCodecDebug.GetValueOnAnyThread() == 1)
{
const float TimeFloat = static_cast<float>(DecodingTime.Get());
UE_LOG(LogGeoCaStreamingCodecV1, Log, TEXT("Decoded frame with %i vertices in %.2f milliseconds."), NumVertices, TimeFloat);
}
return true;