r.Android.DisableEarlyFragmentTests
r.Android.DisableEarlyFragmentTests
#Overview
name: r.Android.DisableEarlyFragmentTests
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Android.DisableEarlyFragmentTests is to control whether early fragment tests are disabled in the rendering pipeline on Android devices. This setting is specifically related to the OpenGL rendering system on Android platforms.
This setting variable is primarily used in the OpenGLDrv module, which is responsible for handling OpenGL rendering on various platforms, including Android. Based on the callsites, it’s clear that this variable is utilized in the Android-specific OpenGL implementation.
The value of this variable is set through a console variable (CVar) system, which allows for runtime configuration. It’s defined as a TAutoConsoleVariable with a default value of 0, meaning early fragment tests are enabled by default.
The associated variable CVarDisableEarlyFragmentTests directly interacts with r.Android.DisableEarlyFragmentTests. They share the same value and purpose.
Developers must be aware that this variable is marked as ECVF_ReadOnly, which means its value should not be changed during runtime. It’s intended to be set before the application starts or through configuration files.
When using this variable, developers should consider the following best practices:
- Only disable early fragment tests if there’s a specific need or performance issue on certain Android devices.
- Test thoroughly on various Android devices to ensure disabling early fragment tests doesn’t negatively impact rendering quality or performance.
- Document the use of this setting in the project, explaining why it’s being modified if changed from the default.
Regarding the associated variable CVarDisableEarlyFragmentTests:
The purpose of CVarDisableEarlyFragmentTests is to provide a programmatic way to access and control the r.Android.DisableEarlyFragmentTests setting within the C++ code.
This variable is used in the AndroidOpenGL.cpp file, which is part of the OpenGLDrv module responsible for Android-specific OpenGL implementations.
The value of CVarDisableEarlyFragmentTests is set when the r.Android.DisableEarlyFragmentTests console variable is initialized. It’s used to check the current setting and apply the appropriate rendering behavior.
CVarDisableEarlyFragmentTests directly interacts with the r.Android.DisableEarlyFragmentTests console variable, serving as its C++ representation.
Developers should be aware that this variable is used to control the behavior of early fragment tests in the rendering pipeline. Its value is checked in the ProcessExtensions function to determine whether to disable early fragment tests.
Best practices for using CVarDisableEarlyFragmentTests include:
- Use GetValueOnAnyThread() to safely read its value from any thread.
- Avoid directly modifying this variable; instead, use the console variable system to change the setting.
- Consider the performance implications of disabling early fragment tests when deciding to use this feature.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1052, section: [Android_Mali_T8xx DeviceProfile]
- INI Section:
Android_Mali_T8xx DeviceProfile
- Raw value:
1
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGL.cpp:46
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDisableEarlyFragmentTests(
TEXT("r.Android.DisableEarlyFragmentTests"),
0,
TEXT("Whether to disable early_fragment_tests if any \n"),
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarDisableFBFNonCoherent(
TEXT("r.Android.DisableFBFNonCoherent"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDisableEarlyFragmentTests
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGL.cpp:45
Scope: file
Source code excerpt:
TEXT(" 2 = hinting always enabled for Adreno devices\n"));
static TAutoConsoleVariable<int32> CVarDisableEarlyFragmentTests(
TEXT("r.Android.DisableEarlyFragmentTests"),
0,
TEXT("Whether to disable early_fragment_tests if any \n"),
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarDisableFBFNonCoherent(
#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGL.cpp:1087
Scope (from outer to inner):
file
function void FAndroidOpenGL::ProcessExtensions
Source code excerpt:
}
if (CVarDisableEarlyFragmentTests.GetValueOnAnyThread() != 0)
{
bRequiresDisabledEarlyFragmentTests = true;
UE_LOG(LogRHI, Log, TEXT("Disabling early_fragment_tests"));
}
}