r.Mobile.SupportGPUScene
r.Mobile.SupportGPUScene
#Overview
name: r.Mobile.SupportGPUScene
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to support GPU scene, required for auto-instancing (only Mobile feature level)
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Mobile.SupportGPUScene is to enable or disable GPU scene support for mobile platforms in Unreal Engine 5. This setting is specifically related to the rendering system, particularly for mobile devices.
This setting variable is primarily used by the rendering subsystem of Unreal Engine, specifically for mobile rendering. It’s referenced in the RenderCore module, which is a core part of the engine’s rendering infrastructure.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with an initial value of 0 (disabled by default) and is marked as read-only and render thread safe.
The associated variable CVarMobileSupportGPUScene interacts directly with r.Mobile.SupportGPUScene. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable is specifically for mobile platforms and affects the support for GPU scene, which is required for auto-instancing. It’s a read-only variable, meaning it cannot be changed at runtime and must be set before engine initialization.
Best practices when using this variable include:
- Only enable it if you’re targeting mobile platforms that support GPU scene features.
- Consider the performance implications of enabling GPU scene on mobile devices.
- Test thoroughly on various mobile devices when enabled, as it may impact rendering performance and quality.
Regarding the associated variable CVarMobileSupportGPUScene:
The purpose of CVarMobileSupportGPUScene is the same as r.Mobile.SupportGPUScene. It’s an internal representation of the console variable used within the engine’s C++ code.
This variable is used in the RenderCore module, specifically in the FReadOnlyCVARCache class, which caches the values of various rendering-related console variables for quick access.
The value of CVarMobileSupportGPUScene is set when the console variable r.Mobile.SupportGPUScene is initialized.
It interacts with other mobile rendering settings, such as mobile deferred shading and mobile HDR settings.
Developers should be aware that this variable is used internally by the engine and should not be modified directly. Instead, they should use the r.Mobile.SupportGPUScene console variable to control this setting.
Best practices for CVarMobileSupportGPUScene are the same as for r.Mobile.SupportGPUScene, as they represent the same setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3587
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarMobileSupportGPUScene(
TEXT("r.Mobile.SupportGPUScene"),
0,
TEXT("Whether to support GPU scene, required for auto-instancing (only Mobile feature level)"),
ECVF_ReadOnly | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarSetClearSceneMethod(
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/ReadOnlyCVARCache.cpp:77
Scope (from outer to inner):
file
function void FReadOnlyCVARCache::Initialize
Source code excerpt:
const auto CVarMobileSkyLightPermutation = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.SkyLightPermutation"));
const auto CVarMobileEnableNoPrecomputedLightingCSMShader = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.EnableNoPrecomputedLightingCSMShader"));
const auto CVarMobileSupportGPUScene = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.SupportGPUScene"));
const bool bForceAllPermutations = CVarSupportAllShaderPermutations && CVarSupportAllShaderPermutations->GetValueOnAnyThread() != 0;
bEnableStationarySkylight = !CVarSupportStationarySkylight || CVarSupportStationarySkylight->GetValueOnAnyThread() != 0 || bForceAllPermutations;
bEnablePointLightShadows = !CVarSupportPointLightWholeSceneShadows || CVarSupportPointLightWholeSceneShadows->GetValueOnAnyThread() != 0 || bForceAllPermutations;
bEnableLowQualityLightmaps = !CVarSupportLowQualityLightmaps || CVarSupportLowQualityLightmaps->GetValueOnAnyThread() != 0 || bForceAllPermutations;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/Shader.cpp:1711
Scope (from outer to inner):
file
function void ShaderMapAppendKeyString
Source code excerpt:
{
// make it per shader platform ?
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Mobile.SupportGPUScene"));
bool bMobileGpuScene = (CVar && CVar->GetInt() != 0);
KeyString += bMobileGpuScene ? TEXT("_MobGPUSc") : TEXT("");
}
{
bool bIsMobileDeferredShading = IsMobileDeferredShadingEnabled(Platform);
#Associated Variable and Callsites
This variable is associated with another variable named CVarMobileSupportGPUScene
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3586
Scope: file
Source code excerpt:
ECVF_ReadOnly | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarMobileSupportGPUScene(
TEXT("r.Mobile.SupportGPUScene"),
0,
TEXT("Whether to support GPU scene, required for auto-instancing (only Mobile feature level)"),
ECVF_ReadOnly | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/ReadOnlyCVARCache.cpp:77
Scope (from outer to inner):
file
function void FReadOnlyCVARCache::Initialize
Source code excerpt:
const auto CVarMobileSkyLightPermutation = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.SkyLightPermutation"));
const auto CVarMobileEnableNoPrecomputedLightingCSMShader = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.EnableNoPrecomputedLightingCSMShader"));
const auto CVarMobileSupportGPUScene = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.Mobile.SupportGPUScene"));
const bool bForceAllPermutations = CVarSupportAllShaderPermutations && CVarSupportAllShaderPermutations->GetValueOnAnyThread() != 0;
bEnableStationarySkylight = !CVarSupportStationarySkylight || CVarSupportStationarySkylight->GetValueOnAnyThread() != 0 || bForceAllPermutations;
bEnablePointLightShadows = !CVarSupportPointLightWholeSceneShadows || CVarSupportPointLightWholeSceneShadows->GetValueOnAnyThread() != 0 || bForceAllPermutations;
bEnableLowQualityLightmaps = !CVarSupportLowQualityLightmaps || CVarSupportLowQualityLightmaps->GetValueOnAnyThread() != 0 || bForceAllPermutations;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/ReadOnlyCVARCache.cpp:99
Scope (from outer to inner):
file
function void FReadOnlyCVARCache::Initialize
Source code excerpt:
bMobileDeferredShadingValue = MobileDeferredShadingIniValue(GMaxRHIShaderPlatform);
bMobileEnableMovableSpotlightsShadowValue = MobileEnableMovableSpotlightsShadowIniValue(GMaxRHIShaderPlatform);
bMobileSupportsGPUScene = CVarMobileSupportGPUScene->GetValueOnAnyThread() != 0;
#ifdef PROJECT_CVAR_ALLOW_STATIC_LIGHTING
check(!!PROJECT_CVAR_ALLOW_STATIC_LIGHTING == bAllowStaticLighting);
#endif
#ifdef PROJECT_CVAR_MOBILE_HDR