r.TSR.16BitVALU
r.TSR.16BitVALU
#Overview
name: r.TSR.16BitVALU
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to use 16bit VALU on platform that have bSupportsRealTypes=RuntimeDependent
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TSR.16BitVALU is to control whether to use 16-bit Vector Arithmetic Logic Unit (VALU) operations in the Temporal Super Resolution (TSR) system on platforms that have runtime-dependent support for real types.
This setting variable is primarily used in the rendering system, specifically within the Temporal Super Resolution subsystem of Unreal Engine 5. The TSR system is responsible for upscaling lower resolution images to higher resolutions while maintaining temporal stability.
Based on the callsites, this variable is utilized in the Renderer module, particularly in the PostProcess/TemporalSuperResolution.cpp file. This suggests that it’s an integral part of the post-processing pipeline for TSR.
The value of this variable is set through a console variable (CVarTSR16BitVALU) with a default value of 1 (enabled). It can be modified at runtime through console commands or programmatically.
This variable interacts with platform-specific capabilities (GRHIGlobals.SupportsNative16BitOps) and shader platform support (FTSRShader::Supports16BitVALU). It’s also used in conjunction with GPU vendor-specific checks on desktop platforms.
Developers should be aware that this setting can affect performance and potentially image quality. Using 16-bit operations can be faster but may introduce some precision loss compared to 32-bit operations.
Best practices when using this variable include:
- Testing performance and image quality with both 16-bit and 32-bit operations to determine the best setting for your specific use case.
- Consider platform-specific behavior, especially on desktop systems where different GPU vendors may have varying support or performance characteristics for 16-bit operations.
- Be cautious when modifying this setting in shipping builds, as it may affect the visual quality or performance of the TSR system.
Regarding the associated variable CVarTSR16BitVALU:
This is the actual console variable that controls the r.TSR.16BitVALU setting. It’s defined as a TAutoConsoleVariable
The purpose of CVarTSR16BitVALU is to provide a way to toggle the use of 16-bit VALU operations in the TSR system through console commands or programmatic access.
This variable is used directly in the AddTemporalSuperResolutionPasses function to determine whether to use 16-bit VALU operations. It’s combined with platform capability checks to make the final decision.
Developers should be aware that changing this console variable at runtime will immediately affect the TSR system’s behavior. It’s important to thoroughly test any changes to ensure they don’t negatively impact performance or image quality across different hardware configurations.
Best practices for using CVarTSR16BitVALU include:
- Use it for debugging and performance testing during development.
- Consider exposing it as a user-configurable setting in graphics options if you want to give players control over this aspect of rendering.
- Monitor its impact on performance and image quality across various hardware configurations to ensure optimal settings for your game.
#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:83
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarTSR16BitVALU(
TEXT("r.TSR.16BitVALU"), 1,
TEXT("Whether to use 16bit VALU on platform that have bSupportsRealTypes=RuntimeDependent"),
ECVF_RenderThreadSafe);
#if PLATFORM_DESKTOP
TAutoConsoleVariable<int32> CVarTSR16BitVALUOnAMD(
#Associated Variable and Callsites
This variable is associated with another variable named CVarTSR16BitVALU
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:82
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTSR16BitVALU(
TEXT("r.TSR.16BitVALU"), 1,
TEXT("Whether to use 16bit VALU on platform that have bSupportsRealTypes=RuntimeDependent"),
ECVF_RenderThreadSafe);
#if PLATFORM_DESKTOP
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1275
Scope (from outer to inner):
file
function FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses
Source code excerpt:
// Whether to use 16bit VALU
const ERHIFeatureSupport VALU16BitSupport = FTSRShader::Supports16BitVALU(View.GetShaderPlatform());
bool bUse16BitVALU = (CVarTSR16BitVALU.GetValueOnRenderThread() != 0 && GRHIGlobals.SupportsNative16BitOps && VALU16BitSupport == ERHIFeatureSupport::RuntimeDependent) || VALU16BitSupport == ERHIFeatureSupport::RuntimeGuaranteed;
// Controls whether to use 16bit ops on per GPU vendor in mean time each driver matures.
#if PLATFORM_DESKTOP
if ((GRHIGlobals.SupportsNative16BitOps && VALU16BitSupport == ERHIFeatureSupport::RuntimeDependent) || VALU16BitSupport == ERHIFeatureSupport::RuntimeGuaranteed)
{
if (IsRHIDeviceAMD())