r.TSR.16BitVALU.Nvidia

r.TSR.16BitVALU.Nvidia

#Overview

name: r.TSR.16BitVALU.Nvidia

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.TSR.16BitVALU.Nvidia is to control whether 16-bit VALU (Vector Arithmetic Logic Unit) operations are used on NVIDIA desktop GPUs for Temporal Super Resolution (TSR) in Unreal Engine 5.

This setting variable is primarily used by the rendering system, specifically the Temporal Super Resolution feature. It is part of the PostProcess module within the Renderer subsystem of Unreal Engine.

The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with an initial value of 0, meaning it’s disabled by default.

The associated variable CVarTSR16BitVALUOnNvidia directly interacts with r.TSR.16BitVALU.Nvidia. They share the same value and purpose.

Developers must be aware that:

  1. This setting is specific to NVIDIA desktop GPUs.
  2. It’s a render thread safe variable, meaning it can be changed at runtime without causing threading issues.
  3. The setting is only applicable on desktop platforms, as indicated by the #ifdef PLATFORM_DESKTOP preprocessor directive.

Best practices when using this variable include:

  1. Only enable it if you’re targeting NVIDIA desktop GPUs specifically.
  2. Test thoroughly to ensure that using 16-bit VALU operations doesn’t introduce visual artifacts or performance issues in your specific use case.
  3. Consider exposing this setting to end-users as an advanced graphics option, allowing them to toggle it based on their hardware and preferences.

Regarding the associated variable CVarTSR16BitVALUOnNvidia:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:100

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


TAutoConsoleVariable<int32> CVarTSR16BitVALUOnNvidia(
	TEXT("r.TSR.16BitVALU.Nvidia"), 0,
	TEXT("Overrides whether to use 16bit VALU on Nvidia desktop GPUs"),
	ECVF_RenderThreadSafe);

#endif // PLATFORM_DESKTOP

TAutoConsoleVariable<float> CVarTSRHistoryRejectionSampleCount(

#Associated Variable and Callsites

This variable is associated with another variable named CVarTSR16BitVALUOnNvidia. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:99

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	ECVF_RenderThreadSafe);

TAutoConsoleVariable<int32> CVarTSR16BitVALUOnNvidia(
	TEXT("r.TSR.16BitVALU.Nvidia"), 0,
	TEXT("Overrides whether to use 16bit VALU on Nvidia desktop GPUs"),
	ECVF_RenderThreadSafe);

#endif // PLATFORM_DESKTOP

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1291

Scope (from outer to inner):

file
function     FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses

Source code excerpt:

		else if (IsRHIDeviceNVIDIA())
		{
			bUse16BitVALU = CVarTSR16BitVALUOnNvidia.GetValueOnRenderThread() != 0;
		}
	}
#endif // PLATFORM_DESKTOP

	// Whether alpha channel is supported.
	const bool bSupportsAlpha = CVarTSRAlphaChannel.GetValueOnRenderThread() >= 0 ? (CVarTSRAlphaChannel.GetValueOnRenderThread() > 0) : IsPostProcessingWithAlphaChannelSupported();