r.DeferSkeletalDynamicDataUpdateUntilGDME

r.DeferSkeletalDynamicDataUpdateUntilGDME

#Overview

name: r.DeferSkeletalDynamicDataUpdateUntilGDME

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.DeferSkeletalDynamicDataUpdateUntilGDME is to control the timing of skeletal mesh dynamic data updates in Unreal Engine 5’s rendering system. Specifically, it determines whether these updates should be deferred until the Gather Dynamic Mesh Elements (GDME) phase of rendering.

This setting variable is primarily used in the Engine module, particularly within the skeletal rendering system. It affects the behavior of GPU-based skinning for skeletal meshes.

The value of this variable is set through a console variable (CVar) system, which allows it to be changed at runtime. It is defined as an integer, where values greater than 0 enable the deferred update behavior.

This variable interacts with other rendering-related variables and flags, such as:

  1. IsParallelGatherDynamicMeshElementsEnabled()
  2. bForceUpdateDynamicDataImmediately
  3. r.RHICmdDeferSkeletalLockAndFillToRHIThread

Developers must be aware that:

  1. This is an experimental option, as indicated in the comment.
  2. It only takes effect when parallel GDME is not enabled.
  3. It can be overridden by the bForceUpdateDynamicDataImmediately flag on individual SkinnedMeshComponents.

Best practices when using this variable include:

  1. Testing thoroughly to ensure it doesn’t introduce visual artifacts or performance issues in your specific use case.
  2. Using it in conjunction with profiling tools to determine if it provides a performance benefit for your game.
  3. Being cautious about enabling it in production builds without extensive testing, given its experimental nature.
  4. Considering the interaction with other related settings, especially when troubleshooting rendering issues or optimizing performance.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalRenderGPUSkin.cpp:521

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarDeferSkeletalDynamicDataUpdateUntilGDME(
	TEXT("r.DeferSkeletalDynamicDataUpdateUntilGDME"),
	0,
	TEXT("If > 0, then do skeletal mesh dynamic data updates will be deferred until GDME. Experimental option."));

FORCEINLINE bool IsDeferredSkeletalDynamicDataUpdateEnabled()
{
	return CVarDeferSkeletalDynamicDataUpdateUntilGDME.GetValueOnRenderThread() > 0 && !IsParallelGatherDynamicMeshElementsEnabled();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Components/SkinnedMeshComponent.h:812

Scope: file

Source code excerpt:

	/**
	   Whether to update dynamic bone & cloth sim data immediately, not to wait until GDME or defer update to RHIThread.
	   When set to true, it is the equivalent of r.DeferSkeletalDynamicDataUpdateUntilGDME=0 and r.RHICmdDeferSkeletalLockAndFillToRHIThread=0.
	   When set to false, r.DeferSkeletalDynamicDataUpdateUntilGDME and r.RHICmdDeferSkeletalLockAndFillToRHIThread values are respected.
	 */
	UPROPERTY(transient)
	uint8 bForceUpdateDynamicDataImmediately : 1;

protected:
	/** Whether we are externally controlling tick rate */
	uint8 bExternalTickRateControlled:1;

	/** Non URO-based interpolation flag */
	uint8 bExternalInterpolate:1;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalRenderGPUSkin.h:147

Scope: file

Source code excerpt:


	// Whether to update dynamic bone & cloth sim data immediately, not to wait until GDME or defer update to RHIThread.
	// When set to true, it is the equivalent of r.DeferSkeletalDynamicDataUpdateUntilGDME=0 and r.RHICmdDeferSkeletalLockAndFillToRHIThread=0.
	// When set to false, r.DeferSkeletalDynamicDataUpdateUntilGDME and r.RHICmdDeferSkeletalLockAndFillToRHIThread values are respected.
	uint8 bForceUpdateDynamicDataImmediately : 1;

#if RHI_RAYTRACING
	uint8 bAnySegmentUsesWorldPositionOffset : 1;
#endif
};