a.VariableKeyLerp.ISPC

a.VariableKeyLerp.ISPC

#Overview

name: a.VariableKeyLerp.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.VariableKeyLerp.ISPC is to control the use of ISPC (Intel SPMD Program Compiler) optimizations in variable key animation encoding within Unreal Engine’s animation system.

This setting variable is primarily used in the Engine’s animation subsystem, specifically in the animation encoding and decoding processes. It is referenced in the Animation module of the Engine.

The value of this variable is set through a console variable (CVar) named “a.VariableKeyLerp.ISPC”. It can be toggled on or off, with the default value defined by ANIM_VARIABLE_KEY_LERP_ISPC_ENABLED_DEFAULT.

The variable interacts with the bAnim_VariableKeyLerp_ISPC_Enabled boolean, which is directly controlled by the console variable.

Developers must be aware that this variable affects the performance and potentially the behavior of animation encoding and decoding. Enabling ISPC optimizations can improve performance, but it may also introduce slight variations in the animation results due to differences in floating-point operations.

Best practices when using this variable include:

  1. Testing animations with both enabled and disabled states to ensure consistency across different hardware.
  2. Benchmarking performance with and without ISPC optimizations to determine if there’s a significant benefit for your specific use case.
  3. Being cautious when changing this setting during runtime, as it may affect ongoing animations.
  4. Considering platform-specific implications, as ISPC optimizations may not be available or beneficial on all hardware.
  5. Documenting the chosen setting in your project to ensure consistent behavior across development and production environments.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

#include "HAL/IConsoleManager.h"
static bool bAnim_VariableKeyLerp_ISPC_Enabled = ANIM_VARIABLE_KEY_LERP_ISPC_ENABLED_DEFAULT;
static FAutoConsoleVariableRef CVarAnimVariableKeyLerpISPCEnabled(TEXT("a.VariableKeyLerp.ISPC"), bAnim_VariableKeyLerp_ISPC_Enabled, TEXT("Whether to use ISPC optimizations in variable 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/IspcTestAnimEncodingVariableKeyLerp.cpp:10

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingVariableKeyLerpGetPoseRotations::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingVariableKeyLerpGetPoseRotations::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.VariableKeyLerp.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/IspcTestAnimEncodingVariableKeyLerp.cpp:104

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingVariableKeyLerpGetPoseTranslations::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingVariableKeyLerpGetPoseTranslations::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.VariableKeyLerp.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/IspcTestAnimEncodingVariableKeyLerp.cpp:198

Scope (from outer to inner):

file
function     bool FIspcTestAnimEncodingVariableKeyLerpGetPoseScales::RunTest

Source code excerpt:

bool FIspcTestAnimEncodingVariableKeyLerpGetPoseScales::RunTest(const FString& Parameters)
{
	const FString CommandName(TEXT("a.VariableKeyLerp.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();