bSupportsUniformBufferObjects
bSupportsUniformBufferObjects
#Overview
name: bSupportsUniformBufferObjects
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsUniformBufferObjects is to indicate whether a specific shader platform supports Uniform Buffer Objects (UBOs). UBOs are a feature in modern graphics APIs that allow for efficient storage and access of shader uniforms.
This setting variable is primarily used within the Rendering Hardware Interface (RHI) subsystem of Unreal Engine 5. It’s part of the data-driven shader platform information system, which allows for flexible configuration of shader platform capabilities.
The value of this variable is set in the ParseDataDrivenShaderInfo function, which reads configuration data from a config section. This suggests that the value can be customized for different shader platforms through configuration files.
bSupportsUniformBufferObjects interacts with other shader platform capability flags, such as bSupportsManualVertexFetch and bSupportsRealTypes. It’s part of a larger set of flags that define the features and limitations of a particular shader platform.
Developers must be aware that this variable affects how shaders are compiled and how uniform data is passed to the GPU. If a platform doesn’t support UBOs, alternative methods for passing uniform data may need to be used.
Best practices when using this variable include:
- Ensure that your shader code is compatible with both UBO and non-UBO platforms if you’re targeting multiple platforms.
- Use the GetSupportsUniformBufferObjects function to check for UBO support at runtime rather than assuming support.
- When implementing custom RHIs for new platforms, correctly set this flag to reflect the platform’s capabilities.
- Be aware that this setting can affect performance and memory usage, so optimize your use of uniform buffers accordingly.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:69, section: [ShaderPlatform OPENGL_ES3_1_ANDROID]
- INI Section:
ShaderPlatform OPENGL_ES3_1_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:90, section: [ShaderPlatform VULKAN_ES3_1_ANDROID]
- INI Section:
ShaderPlatform VULKAN_ES3_1_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:108, section: [ShaderPlatform VULKAN_SM5_ANDROID]
- INI Section:
ShaderPlatform VULKAN_SM5_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:137, section: [ShaderPlatform VULKAN_SM5]
- INI Section:
ShaderPlatform VULKAN_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:255, section: [ShaderPlatform VULKAN_SM6]
- INI Section:
ShaderPlatform VULKAN_SM6
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:275, section: [ShaderPlatform VULKAN_PCES3_1]
- INI Section:
ShaderPlatform VULKAN_PCES3_1
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:182, section: [ShaderPlatform OPENGL_PCES3_1]
- INI Section:
ShaderPlatform OPENGL_PCES3_1
- 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/RHI/Private/DataDrivenShaderPlatformInfo.cpp:291
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
GET_SECTION_BOOL_HELPER(bSupportsNNEShaders);
GET_SECTION_BOOL_HELPER(bSupportsShaderPipelines);
GET_SECTION_BOOL_HELPER(bSupportsUniformBufferObjects);
GET_SECTION_BOOL_HELPER(bRequiresBindfulUtilityShaders);
GET_SECTION_INT_HELPER(MaxSamplers);
GET_SECTION_BOOL_HELPER(SupportsBarycentricsIntrinsics);
GET_SECTION_SUPPORT_HELPER(SupportsBarycentricsSemantic);
GET_SECTION_BOOL_HELPER(bSupportsWave64);
#undef GET_SECTION_BOOL_HELPER
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:475
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms
Source code excerpt:
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);
PREVIEW_FORCE_DISABLE(bSupportsShaderBundleDispatch);
PREVIEW_FORCE_DISABLE(bSupportsRenderTargetWriteMask);
PREVIEW_FORCE_DISABLE(bSupportsIntrinsicWaveOnce);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:117
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 bSupportsNNEShaders: 1;
uint32 bSupportsShaderPipelines : 1;
uint32 bSupportsUniformBufferObjects : 1;
uint32 bRequiresBindfulUtilityShaders : 1;
uint32 MaxSamplers : 8;
uint32 SupportsBarycentricsIntrinsics : 1;
uint32 SupportsBarycentricsSemantic : int32(ERHIFeatureSupport::NumBits);
uint32 bSupportsWave64 : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:761
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetSupportsUniformBufferObjects
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bSupportsUniformBufferObjects;
}
static FORCEINLINE_DEBUGGABLE const bool GetRequiresBindfulUtilityShaders(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bRequiresBindfulUtilityShaders;