r.TSR.16BitVALU.Nvidia
r.TSR.16BitVALU.Nvidia
#Overview
name: r.TSR.16BitVALU.Nvidia
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Overrides whether to use 16bit VALU on Nvidia desktop GPUs
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:
- This setting is specific to NVIDIA desktop GPUs.
- It’s a render thread safe variable, meaning it can be changed at runtime without causing threading issues.
- The setting is only applicable on desktop platforms, as indicated by the #ifdef PLATFORM_DESKTOP preprocessor directive.
Best practices when using this variable include:
- Only enable it if you’re targeting NVIDIA desktop GPUs specifically.
- Test thoroughly to ensure that using 16-bit VALU operations doesn’t introduce visual artifacts or performance issues in your specific use case.
- 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:
- It’s an internal representation of the r.TSR.16BitVALU.Nvidia console variable.
- It’s used in the AddTemporalSuperResolutionPasses function to determine whether to use 16-bit VALU operations.
- The value is checked using GetValueOnRenderThread(), ensuring thread-safe access.
- Developers should use this variable when they need to programmatically check or set the 16-bit VALU usage within C++ code, rather than directly accessing the console variable.
#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();