bSupportsPerPixelDBufferMask

bSupportsPerPixelDBufferMask

#Overview

name: bSupportsPerPixelDBufferMask

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSupportsPerPixelDBufferMask is to indicate whether a specific shader platform supports per-pixel DBuffer masking in the rendering system.

This setting variable is primarily used within the RHI (Rendering Hardware Interface) module of Unreal Engine 5. It’s part of the DataDrivenShaderPlatformInfo system, which provides information about different shader platforms’ capabilities.

The value of this variable is set during the parsing of shader platform information, specifically in the ParseDataDrivenShaderInfo function of the FGenericDataDrivenShaderPlatformInfo class. It’s read from a configuration section, likely defined in an INI file or similar configuration source.

bSupportsPerPixelDBufferMask interacts with other shader platform capabilities variables within the FGenericDataDrivenShaderPlatformInfo class, such as MaxMeshShaderThreadGroupSize, bRequiresUnwrappedMeshShaderArgs, and bIsHlslcc.

Developers must be aware that this variable is platform-specific. Its value may differ across different rendering platforms, affecting how DBuffer masking is handled in shaders.

Best practices when using this variable include:

  1. Always check its value using the GetSupportsPerPixelDBufferMask function rather than accessing it directly.
  2. Consider the implications of per-pixel DBuffer masking support when designing rendering pipelines or shaders.
  3. Ensure that any code relying on per-pixel DBuffer masking has appropriate fallbacks for platforms where it’s not supported.
  4. Use this information to optimize rendering techniques, potentially enabling more advanced effects on supporting platforms while maintaining compatibility with others.

#Setting Variables

#References In INI files

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

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:231, 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:260

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_INT_HELPER(MaxMeshShaderThreadGroupSize);
	GET_SECTION_BOOL_HELPER(bRequiresUnwrappedMeshShaderArgs);
	GET_SECTION_BOOL_HELPER(bSupportsPerPixelDBufferMask);
	GET_SECTION_BOOL_HELPER(bIsHlslcc);
	GET_SECTION_BOOL_HELPER(bSupportsDxc);
	GET_SECTION_BOOL_HELPER(bSupportsVariableRateShading);
	GET_SECTION_BOOL_HELPER(bIsSPIRV);
	GET_SECTION_INT_HELPER(NumberOfComputeThreads);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 MaxMeshShaderThreadGroupSize : 10;
	uint32 bRequiresUnwrappedMeshShaderArgs : 1;
	uint32 bSupportsPerPixelDBufferMask : 1;
	uint32 bIsHlslcc : 1;
	uint32 bSupportsDxc : 1; // Whether DirectXShaderCompiler (DXC) is supported
	uint32 bIsSPIRV : 1;
	uint32 bSupportsVariableRateShading : 1;
	uint32 NumberOfComputeThreads : 10;
	uint32 bWaterUsesSimpleForwardShading : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsPerPixelDBufferMask

Source code excerpt:

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

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