bSupports4ComponentUAVReadWrite

bSupports4ComponentUAVReadWrite

#Overview

name: bSupports4ComponentUAVReadWrite

The value of this variable can be defined or overridden in .ini config files. 11 .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 bSupports4ComponentUAVReadWrite is to indicate whether a specific shader platform supports reading and writing to 4-component Unordered Access Views (UAVs) in shaders. This is a capability related to the rendering system, specifically for advanced GPU compute operations.

This setting variable is primarily used within the RHI (Rendering Hardware Interface) module of Unreal Engine. It’s part of the data-driven shader platform information system, which allows for flexible configuration of shader capabilities across different hardware platforms.

The value of this variable is set through the data-driven shader platform info parsing system. It’s read from a configuration section, likely defined in an INI file, using the GET_SECTION_BOOL_HELPER macro.

This variable interacts with other shader platform capability flags, such as bSupportsMSAA, bSupportsShaderRootConstants, and bSupportsRayTracing. It’s part of a larger set of flags that define the capabilities of a given shader platform.

Developers must be aware that this capability may not be available on all hardware platforms. When writing shaders or implementing rendering features that rely on 4-component UAV read/write operations, they should check this flag to ensure compatibility.

Best practices when using this variable include:

  1. Always check this flag before attempting to use 4-component UAV read/write operations in shaders.
  2. Provide fallback implementations for platforms that don’t support this feature.
  3. Use the GetSupports4ComponentUAVReadWrite() function to query this capability, rather than accessing the flag directly.
  4. Be aware that this capability might be forcibly disabled in preview platforms, as seen in the UpdatePreviewPlatforms() function.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:55, section: [ShaderPlatform METAL]

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:68, section: [ShaderPlatform METAL_MRT]

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:80, section: [ShaderPlatform METAL_SIM]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:51, section: [ShaderPlatform METAL_SM5]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:91, section: [ShaderPlatform METAL_SM6]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:119, section: [ShaderPlatform METAL_MRT_MAC]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:131, section: [ShaderPlatform METAL_MACES3_1]

Location: <Workspace>/Engine/Config/TVOS/DataDrivenPlatformInfo.ini:26, section: [ShaderPlatform METAL_MRT_TVOS]

Location: <Workspace>/Engine/Config/TVOS/DataDrivenPlatformInfo.ini:37, section: [ShaderPlatform METAL_TVOS]

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

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:171, section: [ShaderPlatform VULKAN_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:215

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_SUPPORT_HELPER(SupportsMultiViewport);
	GET_SECTION_BOOL_HELPER(bSupportsMSAA);
	GET_SECTION_BOOL_HELPER(bSupports4ComponentUAVReadWrite);
	GET_SECTION_BOOL_HELPER(bSupportsShaderRootConstants);
	GET_SECTION_BOOL_HELPER(bSupportsShaderBundleDispatch);
	GET_SECTION_BOOL_HELPER(bSupportsRenderTargetWriteMask);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracing);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracingShaders);
	GET_SECTION_BOOL_HELPER(bSupportsInlineRayTracing);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms

Source code excerpt:

				PREVIEW_FORCE_DISABLE(bSupportsIntrinsicWaveOnce);
				PREVIEW_FORCE_DISABLE(bSupportsDOFHybridScattering);
				PREVIEW_FORCE_DISABLE(bSupports4ComponentUAVReadWrite);

				// Make sure we're marked valid
				PreviewInfo.bContainsValidPlatformInfo = true;

				// Seeing as we are merging the two shader platforms merge the hash key as well, this way
				// any changes in the editor feature level shader platform will dirty the preview key.

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 SupportsMultiViewport : int32(ERHIFeatureSupport::NumBits);
	uint32 bSupportsMSAA : 1;
	uint32 bSupports4ComponentUAVReadWrite : 1;
	uint32 bSupportsShaderRootConstants : 1;
	uint32 bSupportsShaderBundleDispatch : 1;
	uint32 bSupportsRenderTargetWriteMask : 1;
	uint32 bSupportsRayTracing : 1;
	uint32 bSupportsRayTracingCallableShaders : 1;
	uint32 bSupportsRayTracingProceduralPrimitive : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupports4ComponentUAVReadWrite

Source code excerpt:

	{
		check(IsValid(Platform));
		return Infos[Platform].bSupports4ComponentUAVReadWrite;
	}

	static FORCEINLINE_DEBUGGABLE const bool GetSupportsSwapchainUAVs(const FStaticShaderPlatform Platform)
	{
		check(IsValid(Platform));
		return Infos[Platform].bSupportsSwapchainUAVs;