a.ConstantKeyLerp.ISPC

a.ConstantKeyLerp.ISPC

#Overview

name: a.ConstantKeyLerp.ISPC

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of a.ConstantKeyLerp.ISPC is to control whether ISPC (Intel SPMD Program Compiler) optimizations are used in constant key animation encoding. This setting variable is primarily used in the animation system of Unreal Engine 5.

The Unreal Engine subsystem that relies on this setting variable is the Animation system, specifically the constant key animation encoding module. It is used in the Engine module, as evidenced by the file paths in the callsites.

The value of this variable is set through the console variable system. It is initialized as a static boolean variable bAnim_ConstantKeyLerp_ISPC_Enabled and linked to the console variable “a.ConstantKeyLerp.ISPC” using FAutoConsoleVariableRef.

This variable interacts with the ISPC-optimized versions of animation encoding functions. When enabled, it allows the engine to use ISPC-optimized code paths for constant key animation encoding, which can potentially improve performance.

Developers must be aware that this variable affects the performance and behavior of constant key animation encoding. Enabling or disabling this variable may impact animation performance and potentially the accuracy of animations, depending on the specific implementation details of the ISPC-optimized code.

Best practices when using this variable include:

  1. Testing the performance impact with and without ISPC optimizations enabled for your specific use case.
  2. Ensuring that enabling ISPC optimizations doesn’t introduce any visual artifacts or inconsistencies in animations.
  3. Considering platform-specific implications, as ISPC optimizations may have different impacts on different hardware.
  4. Using this variable in conjunction with profiling tools to measure its effect on overall animation system performance.
  5. Documenting any project-specific settings or recommendations regarding this variable for your development team.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimEncoding_ConstantKeyLerp.cpp:22

Scope: file

Source code excerpt:

#include "HAL/IConsoleManager.h"
static bool bAnim_ConstantKeyLerp_ISPC_Enabled = ANIM_CONSTANT_KEY_LERP_ISPC_ENABLED_DEFAULT;
static FAutoConsoleVariableRef CVarAnimConstantKeyLerpISPCEnabled(TEXT("a.ConstantKeyLerp.ISPC"), bAnim_ConstantKeyLerp_ISPC_Enabled, TEXT("Whether to use ISPC optimizations in constant key anim encoding"));
#endif

/**
 * Handles the ByteSwap of compressed rotation data on import
 *
 * @param	CompressedData		The compressed animation data being operated on.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/IspcTestAnimEncodingConstantKeyLerp.cpp:10

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingConstantKeyLerpGetPoseRotations::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingConstantKeyLerpGetPoseRotations::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.ConstantKeyLerp.ISPC"));
	auto FormatCommand = [CommandName](bool State) -> FString {
		return FString::Format(TEXT("{0} {1}"), { CommandName, State });
	};

	const IConsoleVariable* CVarISPCEnabled = IConsoleManager::Get().FindConsoleVariable(*CommandName);
	bool InitialState = CVarISPCEnabled->GetBool();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/IspcTestAnimEncodingConstantKeyLerp.cpp:104

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingConstantKeyLerpGetPoseTranslations::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingConstantKeyLerpGetPoseTranslations::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.ConstantKeyLerp.ISPC"));
	auto FormatCommand = [CommandName](bool State) -> FString {
		return FString::Format(TEXT("{0} {1}"), { CommandName, State });
	};

	const IConsoleVariable* CVarISPCEnabled = IConsoleManager::Get().FindConsoleVariable(*CommandName);
	bool InitialState = CVarISPCEnabled->GetBool();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/IspcTestAnimEncodingConstantKeyLerp.cpp:198

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingConstantKeyLerpGetPoseScales::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingConstantKeyLerpGetPoseScales::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.ConstantKeyLerp.ISPC"));
	auto FormatCommand = [CommandName](bool State) -> FString {
		return FString::Format(TEXT("{0} {1}"), { CommandName, State });
	};

	const IConsoleVariable* CVarISPCEnabled = IConsoleManager::Get().FindConsoleVariable(*CommandName);
	bool InitialState = CVarISPCEnabled->GetBool();