r.TSR.WaveSize
r.TSR.WaveSize
#Overview
name: r.TSR.WaveSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Overrides the WaveSize to use.\n 0: Automatic (default);\n 16: WaveSizeOps 16;\n 32: WaveSizeOps 32;\n 64: WaveSizeOps 64;\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TSR.WaveSize is to control the wave size used in Temporal Super Resolution (TSR) operations within Unreal Engine’s rendering system. This setting variable is part of the rendering subsystem, specifically related to the Temporal Super Resolution feature.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the Temporal Super Resolution implementation. It’s defined and used in the TemporalSuperResolution.cpp file.
The value of this variable is set through a console variable (CVarTSRWaveSize) which allows runtime configuration. It can be set to 0 (Automatic), 16, 32, or 64, corresponding to different wave sizes for TSR operations.
The r.TSR.WaveSize interacts closely with other TSR-related variables, particularly CVarTSRWaveOps. The actual use of the wave size depends on whether wave operations are enabled and supported by the hardware.
Developers must be aware that:
- This setting only takes effect when wave operations are enabled and supported by the hardware.
- The default value (0) allows for automatic selection of the wave size.
- The choice of wave size can impact performance and potentially the quality of the TSR effect.
Best practices when using this variable include:
- Leave it at the default (0) unless you have specific performance reasons to change it.
- If changing, test thoroughly on target hardware to ensure performance benefits.
- Be aware of the interaction with other TSR settings, particularly those related to wave operations.
Regarding the associated variable CVarTSRWaveSize: This is the actual console variable that controls the r.TSR.WaveSize setting. It’s an int32 type variable that directly corresponds to the r.TSR.WaveSize console command.
The CVarTSRWaveSize is used in the AddTemporalSuperResolutionPasses function to determine the wave size for TSR operations. It’s checked along with other conditions (like whether wave operations are supported and enabled) to set up the appropriate TSR shader configuration.
Developers should note that this variable is accessed using GetValueOnAnyThread(), which means it can be safely read from any thread. However, changes to this value are expected to be relatively infrequent and typically made through console commands rather than programmatically during runtime.
#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:74
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarTSRWaveSize(
TEXT("r.TSR.WaveSize"), 0,
TEXT("Overrides the WaveSize to use.\n")
TEXT(" 0: Automatic (default);\n")
TEXT(" 16: WaveSizeOps 16;\n")
TEXT(" 32: WaveSizeOps 32;\n")
TEXT(" 64: WaveSizeOps 64;\n"),
ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named CVarTSRWaveSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:73
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTSRWaveSize(
TEXT("r.TSR.WaveSize"), 0,
TEXT("Overrides the WaveSize to use.\n")
TEXT(" 0: Automatic (default);\n")
TEXT(" 16: WaveSizeOps 16;\n")
TEXT(" 32: WaveSizeOps 32;\n")
TEXT(" 64: WaveSizeOps 64;\n"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1271
Scope (from outer to inner):
file
function FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses
Source code excerpt:
const ERHIFeatureSupport WaveOpsSupport = FTSRShader::SupportsWaveOps(View.GetShaderPlatform());
const bool bUseWaveOps = (CVarTSRWaveOps.GetValueOnRenderThread() != 0 && GRHISupportsWaveOperations && (WaveOpsSupport == ERHIFeatureSupport::RuntimeDependent || WaveOpsSupport == ERHIFeatureSupport::RuntimeGuaranteed));
const int32 WaveSizeOverride = bUseWaveOps ? CVarTSRWaveSize.GetValueOnAnyThread() : 0;
// 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.