sg.Test.GPUPerfIndexOverride
sg.Test.GPUPerfIndexOverride
#Overview
name: sg.Test.GPUPerfIndexOverride
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Custom override for the GPU perf index returned by the GPU benchmark.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of sg.Test.GPUPerfIndexOverride is to provide a custom override for the GPU performance index returned by the GPU benchmark in Unreal Engine 5. This setting variable is primarily used for testing and debugging purposes within the engine’s scalability system.
This setting variable is utilized by the Scalability subsystem in Unreal Engine 5, which is responsible for adjusting various graphical settings based on the performance capabilities of the hardware.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 0.0f, which means by default, it doesn’t override the GPU performance index.
The associated variable CVarTestGPUPerfIndexOverride directly interacts with sg.Test.GPUPerfIndexOverride. They share the same value and purpose.
Developers must be aware that this variable is intended for testing purposes only. It should not be used in production builds or relied upon for actual performance scaling in released games. It’s particularly useful when developers need to simulate different GPU performance scenarios without changing the actual hardware.
Best practices when using this variable include:
- Only use it for testing and debugging purposes.
- Reset it to 0.0f after testing to ensure it doesn’t interfere with normal engine operation.
- Be cautious when using it in conjunction with other scalability settings, as it may produce unexpected results.
Regarding the associated variable CVarTestGPUPerfIndexOverride:
- Its purpose is identical to sg.Test.GPUPerfIndexOverride – to provide a custom override for the GPU performance index.
- It’s used in the same Scalability subsystem.
- The value is set through the console variable system, with a default of 0.0f.
- It directly interacts with sg.Test.GPUPerfIndexOverride, as they are essentially the same variable.
- The same awareness and best practices apply to this variable as well.
In the provided code, we can see that CVarTestGPUPerfIndexOverride is checked in the BenchmarkQualityLevels function. If its value is greater than 0.0f, it overrides the GPUPerfIndex value, which is then used to determine various quality settings like resolution quality and view distance quality.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:24
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarTestGPUPerfIndexOverride(
TEXT("sg.Test.GPUPerfIndexOverride"), 0.0f,
TEXT("Custom override for the GPU perf index returned by the GPU benchmark."),
ECVF_Default);
#endif
static TAutoConsoleVariable<float> CVarResolutionQuality(
#Associated Variable and Callsites
This variable is associated with another variable named CVarTestGPUPerfIndexOverride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:23
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<float> CVarTestGPUPerfIndexOverride(
TEXT("sg.Test.GPUPerfIndexOverride"), 0.0f,
TEXT("Custom override for the GPU perf index returned by the GPU benchmark."),
ECVF_Default);
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:693
Scope (from outer to inner):
file
namespace Scalability
function FQualityLevels BenchmarkQualityLevels
Source code excerpt:
CPUPerfIndex = CVarTestCPUPerfIndexOverride.GetValueOnAnyThread();
}
if (CVarTestGPUPerfIndexOverride.GetValueOnAnyThread() > 0.0f)
{
GPUPerfIndex = CVarTestGPUPerfIndexOverride.GetValueOnAnyThread();
}
#endif
// decide on the actual quality needed
Results.ResolutionQuality = GetResolutionQualityFromGPUPerfIndex(GPUPerfIndex);
Results.ViewDistanceQuality = ComputeOptionFromPerfIndex(TEXT("ViewDistanceQuality"), CPUPerfIndex, GPUPerfIndex);