bSupportsPrimitiveShaders
bSupportsPrimitiveShaders
#Overview
name: bSupportsPrimitiveShaders
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsPrimitiveShaders is to indicate whether a specific shader platform supports primitive shaders. Primitive shaders are a feature in modern graphics APIs that allow for more efficient rendering of geometric primitives.
This setting variable is primarily used within the Rendering Hardware Interface (RHI) subsystem of Unreal Engine. It is part of the data-driven shader platform information system, which allows the engine to adapt its rendering capabilities based on the current hardware and graphics API.
The value of this variable is set during the parsing of shader platform information, specifically in the ParseDataDrivenShaderInfo function of the FGenericDataDrivenShaderPlatformInfo class. It is read from a configuration section, likely defined in a platform-specific configuration file.
bSupportsPrimitiveShaders interacts with other capability flags in the FGenericDataDrivenShaderPlatformInfo class, such as bSupportsGPUScene, bSupportsNanite, and bSupportsLumenGI. These flags collectively define the rendering capabilities of a given shader platform.
Developers must be aware that the support for primitive shaders can vary across different hardware and graphics APIs. When using this variable, they should always check its value before attempting to use primitive shader features in their rendering code.
Best practices when using this variable include:
- Always check the value of bSupportsPrimitiveShaders before using primitive shader features.
- Provide fallback rendering paths for platforms that don’t support primitive shaders.
- Use the GetSupportsPrimitiveShaders() static function to query this capability, as it provides a consistent interface and includes necessary validity checks.
- Consider the interaction between primitive shader support and other advanced rendering features like Nanite or Lumen when designing rendering systems.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:59, section: [ShaderPlatform VULKAN_SM5]
- INI Section:
ShaderPlatform VULKAN_SM5
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:181, section: [ShaderPlatform VULKAN_SM6]
- INI Section:
ShaderPlatform VULKAN_SM6
- Raw value:
false
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:230
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
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);
GET_SECTION_BOOL_HELPER(bSupportsTemporalHistoryUpscale);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:459
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms
Source code excerpt:
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsNanite);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsLumenGI);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsPrimitiveShaders);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsUInt64ImageAtomics);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsGen5TemporalAA);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsInlineRayTracing);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsRayTracingShaders);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsMeshShadersTier0);
PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsMeshShadersTier1);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:54
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 bSupportsGPUScene : 1;
uint32 bSupportsByteBufferComputeShaders : 1;
uint32 bSupportsPrimitiveShaders : 1;
uint32 bSupportsUInt64ImageAtomics : 1;
uint32 bRequiresVendorExtensionsForAtomics : 1;
uint32 bSupportsNanite : 1;
uint32 bSupportsLumenGI : 1;
uint32 bSupportsSSDIndirect : 1;
uint32 bSupportsTemporalHistoryUpscale : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:467
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetSupportsPrimitiveShaders
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bSupportsPrimitiveShaders;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsUInt64ImageAtomics(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsUInt64ImageAtomics;