bSupportsIntrinsicWaveOnce

bSupportsIntrinsicWaveOnce

#Overview

name: bSupportsIntrinsicWaveOnce

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSupportsIntrinsicWaveOnce is to indicate whether the current shader platform supports wave intrinsic operations, specifically the “wave once” functionality. This is a GPU feature that allows for efficient communication and synchronization between threads within a wave (a group of threads that execute in parallel).

This setting variable is primarily used in the rendering system of Unreal Engine 5, specifically in shader compilation and execution. It’s referenced in the Niagara plugin for particle effects and in the core RHI (Rendering Hardware Interface) module.

The value of this variable is set during the initialization of shader platform information, typically when the engine starts up or when shader platforms are being configured. It’s parsed from a data-driven configuration in the FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo function.

This variable interacts with other wave-related variables like bSupportsWaveOperations, bSupportsWavePermute, MinimumWaveSize, and MaximumWaveSize. Together, these variables define the capabilities and constraints of wave operations on the current platform.

Developers must be aware that this feature may not be available on all platforms or GPUs. The code in NiagaraShader.h shows a commented-out usage, indicating that enabling this feature might break some existing content. This suggests that careful testing is required when utilizing this feature.

Best practices when using this variable include:

  1. Always check if the feature is supported before using it in shaders.
  2. Test thoroughly on multiple platforms to ensure compatibility.
  3. Consider providing fallback code for platforms that don’t support this feature.
  4. Be cautious when enabling it, as it may impact existing content or performance.
  5. Use it in conjunction with other wave-related variables to fully leverage wave intrinsics capabilities.

#Setting Variables

#References In INI files

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

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraShader/Public/NiagaraShader.h:224

Scope: file

Source code excerpt:

	{
		FShader::ModifyCompilationEnvironment(Parameters, OutEnvironment);
		const bool bUseWaveIntrinsics = false; // TODO: Some content breaks with this - FDataDrivenShaderPlatformInfo::GetInfo(Platform).bSupportsIntrinsicWaveOnce;
		OutEnvironment.SetDefine(TEXT("USE_WAVE_INTRINSICS"), bUseWaveIntrinsics ? 1 : 0);
	}

	FNiagaraShader() {}
	NIAGARASHADER_API FNiagaraShader(const FNiagaraShaderType::CompiledShaderInitializerType& Initializer);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsTemporalHistoryUpscale);
	GET_SECTION_BOOL_HELPER(bSupportsRTIndexFromVS);
	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);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms

Source code excerpt:

				PREVIEW_FORCE_DISABLE(bSupportsShaderBundleDispatch);
				PREVIEW_FORCE_DISABLE(bSupportsRenderTargetWriteMask);
				PREVIEW_FORCE_DISABLE(bSupportsIntrinsicWaveOnce);
				PREVIEW_FORCE_DISABLE(bSupportsDOFHybridScattering);
				PREVIEW_FORCE_DISABLE(bSupports4ComponentUAVReadWrite);

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

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 MinimumWaveSize : 8;
	uint32 MaximumWaveSize : 8;
	uint32 bSupportsIntrinsicWaveOnce : 1;
	uint32 bSupportsConservativeRasterization : 1;
	uint32 bRequiresExplicit128bitRT : 1;
	uint32 bSupportsGen5TemporalAA : 1;
	uint32 bTargetsTiledGPU : 1;
	uint32 bNeedsOfflineCompiler : 1;
	uint32 bSupportsComputeFramework : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsIntrinsicWaveOnce

Source code excerpt:

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

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