BindlessSupport

BindlessSupport

#Overview

name: BindlessSupport

The value of this variable can be defined or overridden in .ini config files. 4 .ini config files referencing this setting variable.

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of BindlessSupport is to determine the level of support for bindless resources in the rendering hardware interface (RHI) of Unreal Engine 5. Bindless resources allow for more efficient GPU resource management and can significantly improve rendering performance in certain scenarios.

This setting variable is primarily used by the RHI subsystem of Unreal Engine 5, which is responsible for abstracting the low-level graphics API interactions. It’s also referenced in the shader compilation and management systems.

The value of this variable is typically set based on the capabilities of the underlying graphics hardware and driver. It’s parsed from configuration files or command-line arguments in the RHIParseBindlessConfiguration function.

BindlessSupport interacts with other variables and systems related to shader compilation, resource management, and rendering pipeline configuration. It’s often used in conjunction with other graphics-related settings to determine the overall capabilities of the rendering system.

Developers should be aware that:

  1. The level of bindless support can vary between different hardware and platforms.
  2. Enabling bindless resources may require specific shader modifications and resource management strategies.
  3. Some platforms may only support bindless resources for specific features (e.g., ray tracing).

Best practices when using this variable include:

  1. Always check the level of bindless support before attempting to use bindless resources.
  2. Design fallback paths for platforms or configurations where bindless support is limited or unavailable.
  3. Consider the performance implications of using bindless resources, as they may not always provide a benefit on all hardware configurations.
  4. When developing cross-platform applications, ensure that your code can adapt to different levels of bindless support.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:135, section: [ShaderPlatform VULKAN_SM5]

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:253, section: [ShaderPlatform VULKAN_SM6]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:72, section: [ShaderPlatform PCD3D_SM5]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:129, section: [ShaderPlatform PCD3D_SM6]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:280

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsFFTBloom);
	GET_SECTION_BOOL_HELPER(bSupportsVertexShaderLayer);
	GET_SECTION_BINDLESS_SUPPORT_HELPER(BindlessSupport);
	GET_SECTION_BOOL_HELPER(bSupportsVolumeTextureAtomics);
	GET_SECTION_BOOL_HELPER(bSupportsROV);
	GET_SECTION_BOOL_HELPER(bSupportsOIT);
	GET_SECTION_SUPPORT_HELPER(bSupportsRealTypes);
	GET_SECTION_INT_HELPER(EnablesHLSL2021ByDefault);
	GET_SECTION_BOOL_HELPER(bSupportsSceneDataCompressedTransforms);

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHI.cpp:1231

Scope (from outer to inner):

file
function     ERHIBindlessConfiguration RHIParseBindlessConfiguration

Source code excerpt:

ERHIBindlessConfiguration RHIParseBindlessConfiguration(EShaderPlatform Platform, const FString& ConfigSettingString, const FString& CVarSettingString)
{
	const ERHIBindlessSupport BindlessSupport = RHIGetBindlessSupport(Platform);

	if (BindlessSupport == ERHIBindlessSupport::Unsupported)
	{
		return ERHIBindlessConfiguration::Disabled;
	}

#if WITH_EDITOR
	// We have to check the -bindless command line option here to make sure the shaders are compiled with bindless enabled too.

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHI.cpp:1256

Scope (from outer to inner):

file
function     ERHIBindlessConfiguration RHIParseBindlessConfiguration

Source code excerpt:


	// There's no choice here if the platform only supports RayTracing.
	if (BindlessSupport == ERHIBindlessSupport::RayTracingOnly)
	{
		return ERHIBindlessConfiguration::RayTracingShaders;
	}

	// CVar should always take precedence over the config setting
	return CVarSetting != ERHIBindlessConfiguration::Disabled ? CVarSetting : ConfigSetting;

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHI.cpp:1267

Scope (from outer to inner):

file
function     static ERHIBindlessConfiguration DetermineBindlessConfiguration

Source code excerpt:

static ERHIBindlessConfiguration DetermineBindlessConfiguration(EShaderPlatform Platform, const TCHAR* ConfigName, const FString& CVarSetting)
{
	const ERHIBindlessSupport BindlessSupport = RHIGetBindlessSupport(Platform);
	if (BindlessSupport == ERHIBindlessSupport::Unsupported)
	{
		return ERHIBindlessConfiguration::Disabled;
	}

	FString ConfigSetting;
	GetBindlessConfigurationSetting(ConfigSetting, Platform, ConfigName);

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:105

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsRayTracingShaders : 1;
	uint32 bSupportsVertexShaderLayer : 1;
	uint32 BindlessSupport : int32(ERHIBindlessSupport::NumBits);
	uint32 bSupportsVolumeTextureAtomics : 1;
	uint32 bSupportsROV : 1;
	uint32 bSupportsOIT : 1;
	uint32 bSupportsRealTypes : int32(ERHIFeatureSupport::NumBits);
	uint32 EnablesHLSL2021ByDefault : 2; // 0: disabled, 1: global shaders only, 2: all shaders
	uint32 bSupportsSceneDataCompressedTransforms : 1;

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:708

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const ERHIBindlessSupport GetBindlessSupport

Source code excerpt:

	{
		check(IsValid(Platform));
		return static_cast<ERHIBindlessSupport>(Infos[Platform].BindlessSupport);
	}

	static FORCEINLINE_DEBUGGABLE const bool GetSupportsVolumeTextureAtomics(const FStaticShaderPlatform Platform)
	{
		return Infos[Platform].bSupportsVolumeTextureAtomics;
	}

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/RHIGlobals.h:602

Scope: file

Source code excerpt:


	/** Whether dynamic (bindless) resources are supported */
	ERHIBindlessSupport BindlessSupport = ERHIBindlessSupport::Unsupported;

	struct FReservedResources
	{
		/**
		* True if the RHI supports reserved (AKA tiled, virtual or sparse) resources and operations related to them.
		* Buffers and 2D textures (without mips) can be created with ReservedResource flag.