bSupportsWaveOperations

bSupportsWaveOperations

#Overview

name: bSupportsWaveOperations

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSupportsWaveOperations is to indicate whether the current shader platform supports wave operations in GPU shader execution. Wave operations are GPU-specific intrinsics that allow for efficient communication and synchronization between threads within a wave (also known as a warp or wavefront).

This setting variable is primarily used in the RHI (Rendering Hardware Interface) subsystem of Unreal Engine 5. It’s part of the data-driven shader platform information system, which helps the engine determine the capabilities of different graphics hardware and APIs.

The value of this variable is set through the data-driven shader platform info parsing process, as seen in the FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo function. It’s likely populated from a configuration file or hardware detection process during engine initialization.

bSupportsWaveOperations interacts with other wave-related variables such as bSupportsWavePermute, MinimumWaveSize, and MaximumWaveSize. These variables collectively describe the wave operation capabilities of the GPU.

Developers must be aware that this variable represents a capability, not a guarantee. The actual support for wave operations may vary depending on the specific hardware and driver versions. It’s also important to note that this is stored as an ERHIFeatureSupport enum, which allows for more nuanced support levels beyond a simple boolean.

Best practices when using this variable include:

  1. Always check for support before using wave operations in shaders.
  2. Use the GetSupportsWaveOperations() function to query the support level, rather than accessing the variable directly.
  3. Consider providing fallback code paths for platforms that don’t support wave operations.
  4. Be aware of the minimum and maximum wave sizes when designing algorithms that rely on wave operations.
  5. Use in conjunction with other wave-related variables to ensure comprehensive compatibility checks.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:125, section: [ShaderPlatform VULKAN_SM5_ANDROID]

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

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

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

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

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:108, 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:240

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsIntrinsicWaveOnce);
	GET_SECTION_BOOL_HELPER(bSupportsConservativeRasterization);
	GET_SECTION_SUPPORT_HELPER(bSupportsWaveOperations);
	GET_SECTION_BOOL_HELPER(bSupportsWavePermute);
	GET_SECTION_INT_HELPER(MinimumWaveSize);
	GET_SECTION_INT_HELPER(MaximumWaveSize);
	GET_SECTION_BOOL_HELPER(bRequiresExplicit128bitRT);
	GET_SECTION_BOOL_HELPER(bSupportsGen5TemporalAA);
	GET_SECTION_BOOL_HELPER(bTargetsTiledGPU);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsTemporalHistoryUpscale : 1;
	uint32 bSupportsRTIndexFromVS : 1;
	uint32 bSupportsWaveOperations : int32(ERHIFeatureSupport::NumBits);
	uint32 bSupportsWavePermute : 1;
	uint32 MinimumWaveSize : 8;
	uint32 MaximumWaveSize : 8;
	uint32 bSupportsIntrinsicWaveOnce : 1;
	uint32 bSupportsConservativeRasterization : 1;
	uint32 bRequiresExplicit128bitRT : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const ERHIFeatureSupport GetSupportsWaveOperations

Source code excerpt:

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

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