bSupportsGPUScene
bSupportsGPUScene
#Overview
name: bSupportsGPUScene
The value of this variable can be defined or overridden in .ini config files. 7
.ini config files referencing this setting variable.
It is referenced in 16
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsGPUScene is to indicate whether a primitive or mesh supports the GPU Scene feature in Unreal Engine 5. This variable is used primarily in the rendering system to determine how certain elements should be processed and rendered.
bSupportsGPUScene is utilized by several Unreal Engine subsystems and modules, primarily within the rendering pipeline. The main modules that rely on this variable are:
- Engine
- Renderer
- RHI (Runtime Hardware Interface)
The value of this variable is typically set in different places depending on the context:
- In FPrimitiveSceneProxy, it’s set in the EnableGPUSceneSupportFlags function.
- For static meshes, it’s determined by the vertex factory’s SupportsGPUScene function.
- For shader platforms, it’s parsed from data-driven shader information.
This variable interacts with other variables and systems, such as:
- bUseGPUScene, which determines whether GPU Scene should be used at all.
- VertexFactory configurations, as the support for GPU Scene depends on the vertex factory setup.
- Shader platform capabilities, as not all platforms may support GPU Scene.
Developers should be aware of the following when using this variable:
- It affects how primitives and meshes are processed in the rendering pipeline.
- It can impact performance and memory usage, as GPU Scene is an optimization technique.
- Its value can vary depending on the specific mesh, primitive, or platform being used.
Best practices when using this variable include:
- Ensure that the GPU Scene feature is properly supported on target platforms before relying on it.
- Use it in conjunction with other rendering optimizations for best performance.
- Be aware of its impact on different rendering passes, such as shadow rendering.
- Consider platform-specific differences when developing for multiple targets.
- Regularly test and profile to ensure that enabling GPU Scene support actually improves performance for your specific use case.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:118, section: [ShaderPlatform VULKAN_SM5_ANDROID]
- INI Section:
ShaderPlatform VULKAN_SM5_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:41, section: [ShaderPlatform METAL_SM5]
- INI Section:
ShaderPlatform METAL_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:81, section: [ShaderPlatform METAL_SM6]
- INI Section:
ShaderPlatform METAL_SM6
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:56, section: [ShaderPlatform VULKAN_SM5]
- INI Section:
ShaderPlatform VULKAN_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:180, section: [ShaderPlatform VULKAN_SM6]
- INI Section:
ShaderPlatform VULKAN_SM6
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:49, section: [ShaderPlatform PCD3D_SM5]
- INI Section:
ShaderPlatform PCD3D_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:100, section: [ShaderPlatform PCD3D_SM6]
- INI Section:
ShaderPlatform PCD3D_SM6
- Raw value:
true
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveSceneProxy.cpp:466
Scope: file
Source code excerpt:
, bIsHierarchicalInstancedStaticMesh(false)
, bIsLandscapeGrass(false)
, bSupportsGPUScene(false)
, bHasDeformableMesh(true)
, bEvaluateWorldPositionOffset(true)
, bHasWorldPositionOffsetVelocity(false)
, bAnyMaterialHasWorldPositionOffset(false)
, bAnyMaterialAlwaysEvaluatesWorldPositionOffset(false)
, bAnyMaterialHasPixelAnimation(false)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveSceneProxy.cpp:1295
Scope (from outer to inner):
file
function void FPrimitiveSceneProxy::EnableGPUSceneSupportFlags
Source code excerpt:
bVFRequiresPrimitiveUniformBuffer = !bUseGPUScene;
// For mobile we always assume that proxy does not support GPUScene, as it depends on vertex factory setup which happens later
bSupportsGPUScene = bMobilePath ? false : bUseGPUScene;
}
/**
* Updates the hidden editor view visibility map on the game thread which just enqueues a command on the render thread
*/
void FPrimitiveSceneProxy::SetHiddenEdViews_GameThread( uint64 InHiddenEditorViews )
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/PrimitiveSceneProxy.h:864
Scope (from outer to inner):
file
class class FPrimitiveSceneProxy
function inline bool SupportsGPUScene
Source code excerpt:
inline bool SupportsGPUScene() const
{
return bSupportsGPUScene;
}
/**
* Returns true if this proxy has any deformable mesh, meaning the mesh is animated e.g., by deforming the vertices through skinning, morphing or some procedural update.
* WPO and PDO are not considered here (as they are material effects).
*/
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/PrimitiveSceneProxy.h:1343
Scope (from outer to inner):
file
class class FPrimitiveSceneProxy
Source code excerpt:
/** True if all meshes (AKA all vertex factories) drawn by this proxy support GPU scene (default is false). */
uint8 bSupportsGPUScene : 1;
/** True if the mesh representation is deformable (see HasDeformableMesh() above for more details). Defaults to true to be conservative. */
uint8 bHasDeformableMesh : 1;
/** Whether the primitive should evaluate any World Position Offset. */
uint8 bEvaluateWorldPositionOffset : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:229
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
GET_SECTION_BOOL_HELPER(bSupportsHighEndRayTracingEffects);
GET_SECTION_BOOL_HELPER(bSupportsByteBufferComputeShaders);
GET_SECTION_BOOL_HELPER(bSupportsGPUScene);
GET_SECTION_BOOL_HELPER(bSupportsPrimitiveShaders);
GET_SECTION_BOOL_HELPER(bSupportsUInt64ImageAtomics);
GET_SECTION_BOOL_HELPER(bRequiresVendorExtensionsForAtomics);
GET_SECTION_BOOL_HELPER(bSupportsNanite);
GET_SECTION_BOOL_HELPER(bSupportsLumenGI);
GET_SECTION_BOOL_HELPER(bSupportsSSDIndirect);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:469
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms
Source code excerpt:
// Settings that need to match the runtime
PREVIEW_USE_RUNTIME_VALUE(bSupportsGPUScene);
PREVIEW_USE_RUNTIME_VALUE(MaxMeshShaderThreadGroupSize);
PREVIEW_USE_RUNTIME_VALUE(bSupportsSceneDataCompressedTransforms);
PREVIEW_USE_RUNTIME_VALUE(bSupportsVertexShaderSRVs);
PREVIEW_USE_RUNTIME_VALUE(bSupportsManualVertexFetch);
PREVIEW_USE_RUNTIME_VALUE(bSupportsRealTypes);
PREVIEW_USE_RUNTIME_VALUE(bSupportsUniformBufferObjects);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:52
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 bSupportsHighEndRayTracingEffects : 1; // Whether fully-featured RT effects can be used on the platform (with translucent shadow, etc.)
uint32 bSupportsPathTracing : 1; // Whether real-time path tracer is supported on this platform (avoids compiling unnecessary shaders)
uint32 bSupportsGPUScene : 1;
uint32 bSupportsByteBufferComputeShaders : 1;
uint32 bSupportsPrimitiveShaders : 1;
uint32 bSupportsUInt64ImageAtomics : 1;
uint32 bRequiresVendorExtensionsForAtomics : 1;
uint32 bSupportsNanite : 1;
uint32 bSupportsLumenGI : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:455
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetSupportsGPUScene
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bSupportsGPUScene;
}
static FORCEINLINE_DEBUGGABLE const bool GetRequiresExplicit128bitRT(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bRequiresExplicit128bitRT;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PrimitiveSceneInfo.cpp:131
Scope (from outer to inner):
file
class class FBatchingSPDI : public FStaticPrimitiveDrawInterface
function virtual void DrawMesh
Source code excerpt:
bool bUseAnisotropy = Material.GetShadingModels().HasAnyShadingModel({MSM_DefaultLit, MSM_ClearCoat}) && Material.MaterialUsesAnisotropy_RenderThread();
bool bSupportsNaniteRendering = SupportsNaniteRendering(StaticMesh->VertexFactory, PrimitiveSceneProxy, Mesh.MaterialRenderProxy, FeatureLevel);
bool bSupportsGPUScene = StaticMesh->VertexFactory->SupportsGPUScene(FeatureLevel);
bool bUseForWaterInfoTextureDepth = Mesh.bUseForWaterInfoTextureDepth;
bool bUseForLumenSceneCapture = Mesh.bUseForLumenSurfaceCacheCapture;
FStaticMeshBatchRelevance* StaticMeshRelevance = new(PrimitiveSceneInfo->StaticMeshRelevances) FStaticMeshBatchRelevance(
*StaticMesh,
ScreenSize,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PrimitiveSceneInfo.cpp:143
Scope (from outer to inner):
file
class class FBatchingSPDI : public FStaticPrimitiveDrawInterface
function virtual void DrawMesh
Source code excerpt:
bUseAnisotropy,
bSupportsNaniteRendering,
bSupportsGPUScene,
bUseForWaterInfoTextureDepth,
bUseForLumenSceneCapture,
FeatureLevel
);
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PrimitiveSceneInfo.cpp:165
Scope (from outer to inner):
file
function FPrimitiveFlagsCompact::FPrimitiveFlagsCompact
Source code excerpt:
, bIsNaniteMesh(Proxy->IsNaniteMesh())
, bIsAlwaysVisible(Proxy->IsAlwaysVisible())
, bSupportsGPUScene(Proxy->SupportsGPUScene())
{}
FPrimitiveSceneInfoCompact::FPrimitiveSceneInfoCompact(FPrimitiveSceneInfo* InPrimitiveSceneInfo) :
PrimitiveFlagsCompact(InPrimitiveSceneInfo->Proxy)
{
PrimitiveSceneInfo = InPrimitiveSceneInfo;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ShadowSetup.cpp:1756
Scope (from outer to inner):
file
function bool FProjectedShadowInfo::ShouldDrawStaticMesh
Source code excerpt:
bOutDrawingStaticMeshes = true;
if (EnumHasAnyFlags(MeshSelectionMask, StaticMeshRelevance.bSupportsGPUScene ? EShadowMeshSelection::VSM : EShadowMeshSelection::SM))
{
return true;
}
}
return false;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ShadowSetup.cpp:2251
Scope (from outer to inner):
file
function uint64 FProjectedShadowInfo::AddSubjectPrimitive_AnyThread
Source code excerpt:
}
// EShadowMeshSelection::All is intentional because bSupportsGPUScene being false may indicate that some VFs (e.g., some LODs) support GPUScene while others don't
// thus we have to leave the final decision until the mesh batches are produced.
if (!bDrawingStaticMeshes && bDynamicRelevance && EnumHasAnyFlags(MeshSelectionMask, PrimitiveSceneInfoCompact.PrimitiveFlagsCompact.bSupportsGPUScene ? EShadowMeshSelection::VSM : EShadowMeshSelection::All))
{
Result.bDynamicSubjectPrimitive = true;
++OutStats.NumDynamicSubs;
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/StaticMeshBatch.cpp:49
Scope (from outer to inner):
file
function FStaticMeshBatchRelevance::FStaticMeshBatchRelevance
Source code excerpt:
, bSupportsCachingMeshDrawCommands(InbSupportsCachingMeshDrawCommands)
, bSupportsNaniteRendering(bInSupportsNaniteRendering)
, bSupportsGPUScene(bInSupportsGPUScene)
, bUseForWaterInfoTextureDepth(bInUseForWaterInfoTextureDepth)
, bUseForLumenSceneCapture(bInUseForLumenSceneCapture)
{
}
int32 FStaticMeshBatchRelevance::GetStaticMeshCommandInfoIndex(EMeshPass::Type MeshPass) const
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/PrimitiveSceneInfo.h:192
Scope: file
Source code excerpt:
/** True if the primitive draws only meshes that support GPU-Scene. */
uint8 bSupportsGPUScene : 1;
FPrimitiveFlagsCompact(const FPrimitiveSceneProxy* Proxy);
};
/** The information needed to determine whether a primitive is visible. */
class FPrimitiveSceneInfoCompact
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/StaticMeshBatch.h:91
Scope (from outer to inner):
file
class class FStaticMeshBatchRelevance
Source code excerpt:
/** Cached from vertex factory to avoid dereferencing VF in shadow depth rendering. */
uint8 bSupportsGPUScene : 1;
/** Whether the mesh batch should be used in the depth-only passes of rendering the water info texture for the water plugin */
uint8 bUseForWaterInfoTextureDepth : 1;
/** Cached from lumen scene card capture */
uint8 bUseForLumenSceneCapture : 1;