bSupportsVertexShaderSRVs
bSupportsVertexShaderSRVs
#Overview
name: bSupportsVertexShaderSRVs
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsVertexShaderSRVs is to indicate whether the current shader platform supports Shader Resource Views (SRVs) in vertex shaders. This is an important capability for rendering systems, particularly for advanced vertex processing techniques.
This setting variable is primarily used within the Unreal Engine’s rendering subsystem, specifically in the shader compilation and RHI (Rendering Hardware Interface) modules. It’s referenced in the ShaderCompiler and DataDrivenShaderPlatformInfo components.
The value of this variable is set in multiple places:
- It’s initially set to true in the FGenericDataDrivenShaderPlatformInfo::SetDefaultValues function.
- It can be overridden through a data-driven approach, likely through configuration files, as seen in the ParseDataDrivenShaderInfo function.
- For preview platforms, its value is determined at runtime, as shown in the UpdatePreviewPlatforms function.
This variable interacts with other shader and rendering-related variables, such as bSupportsManualVertexFetch and MaxSamplers. It’s used in conjunction with these to determine the capabilities and limitations of the current rendering platform.
Developers should be aware that this variable’s value can vary depending on the target platform. While it’s set to true by default, it’s explicitly overridden to false for ES 3.1 platforms via DDPI (Data-Driven Platform Info) ini files.
Best practices when using this variable include:
- Always check its value before attempting to use SRVs in vertex shaders.
- Be prepared to provide alternative implementations for platforms that don’t support vertex shader SRVs.
- Use the FDataDrivenShaderPlatformInfo::GetSupportsVertexShaderSRVs function to query this capability, rather than accessing the variable directly.
- Consider the performance implications of using SRVs in vertex shaders, even on platforms that support them, as they may have different performance characteristics compared to other methods of data access.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:68, section: [ShaderPlatform OPENGL_ES3_1_ANDROID]
- INI Section:
ShaderPlatform OPENGL_ES3_1_ANDROID
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:89, section: [ShaderPlatform VULKAN_ES3_1_ANDROID]
- INI Section:
ShaderPlatform VULKAN_ES3_1_ANDROID
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:106, section: [ShaderPlatform VULKAN_SM5_ANDROID]
- INI Section:
ShaderPlatform VULKAN_SM5_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:274, section: [ShaderPlatform VULKAN_PCES3_1]
- INI Section:
ShaderPlatform VULKAN_PCES3_1
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:181, section: [ShaderPlatform OPENGL_PCES3_1]
- INI Section:
ShaderPlatform OPENGL_PCES3_1
- 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/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:8369
Scope (from outer to inner):
file
function void GlobalBeginCompileShader
Source code excerpt:
{
const bool bSupportsVertexShaderSRVs = FDataDrivenShaderPlatformInfo::GetSupportsVertexShaderSRVs((EShaderPlatform)Target.Platform);
SET_SHADER_DEFINE(Input.Environment, PLATFORM_SUPPORTS_VERTEX_SHADER_SRVS, bSupportsVertexShaderSRVs ? 1u : 0u);
}
{
const uint32 MaxSamplers = FDataDrivenShaderPlatformInfo::GetMaxSamplers((EShaderPlatform)Target.Platform);
SET_SHADER_DEFINE(Input.Environment, PLATFORM_MAX_SAMPLERS, MaxSamplers);
}
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:143
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::SetDefaultValues
Source code excerpt:
bSupportsWaterIndirectDraw = true;
bSupportsAsyncPipelineCompilation = true;
bSupportsVertexShaderSRVs = true; // Explicitly overriden to false for ES 3.1 platforms via DDPI ini
bSupportsManualVertexFetch = true;
bSupportsVolumeTextureAtomics = true;
bSupportsClipDistance = true;
bSupportsShaderPipelines = true;
MaxSamplers = 16;
}
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:274
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
GET_SECTION_BOOL_HELPER(bSupportsWaterIndirectDraw);
GET_SECTION_BOOL_HELPER(bSupportsAsyncPipelineCompilation);
GET_SECTION_BOOL_HELPER(bSupportsVertexShaderSRVs);
GET_SECTION_BOOL_HELPER(bSupportsManualVertexFetch);
GET_SECTION_BOOL_HELPER(bRequiresReverseCullingOnMobile);
GET_SECTION_BOOL_HELPER(bOverrideFMaterial_NeedsGBufferEnabled);
GET_SECTION_BOOL_HELPER(bSupportsFFTBloom);
GET_SECTION_BOOL_HELPER(bSupportsVertexShaderLayer);
GET_SECTION_BINDLESS_SUPPORT_HELPER(BindlessSupport);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:472
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms
Source code excerpt:
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);
// Settings that will never be supported in preview
PREVIEW_FORCE_DISABLE(bSupportsShaderRootConstants);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:97
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 bSupportsWaterIndirectDraw : 1;
uint32 bSupportsAsyncPipelineCompilation : 1;
uint32 bSupportsVertexShaderSRVs : 1; // Whether SRVs can be bound to vertex shaders (may be independent from ManualVertexFetch)
uint32 bSupportsManualVertexFetch : 1;
uint32 bRequiresReverseCullingOnMobile : 1;
uint32 bOverrideFMaterial_NeedsGBufferEnabled : 1;
uint32 bSupportsFFTBloom : 1;
uint32 bSupportsInlineRayTracing : 1;
uint32 bSupportsRayTracingShaders : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:665
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetSupportsVertexShaderSRVs
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bSupportsVertexShaderSRVs;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsManualVertexFetch(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsManualVertexFetch;