bSupportsMeshShadersWithClipDistance

bSupportsMeshShadersWithClipDistance

#Overview

name: bSupportsMeshShadersWithClipDistance

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSupportsMeshShadersWithClipDistance is to indicate whether the current shader platform supports mesh shaders with clip distance functionality. This setting is related to the rendering system, specifically the mesh shader pipeline.

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

The value of this variable is set in the FGenericDataDrivenShaderPlatformInfo class, which is populated by parsing a configuration section. This parsing occurs in the ParseDataDrivenShaderInfo function.

bSupportsMeshShadersWithClipDistance interacts with other mesh shader-related variables such as bSupportsMeshShadersTier0, bSupportsMeshShadersTier1, and MaxMeshShaderThreadGroupSize. These variables collectively define the mesh shader capabilities of a given platform.

Developers must be aware that this variable is platform-specific. Its value may differ depending on the target hardware and graphics API. It’s crucial to check this value before attempting to use mesh shaders with clip distance functionality in your rendering code.

Best practices when using this variable include:

  1. Always check its value using the GetSupportsMeshShadersWithClipDistance function before implementing mesh shaders with clip distance.
  2. Consider providing fallback rendering paths for platforms that don’t support this feature.
  3. Use this variable in conjunction with other mesh shader-related settings to ensure full compatibility and optimal performance.
  4. Keep in mind that this is part of a data-driven system, so its value can potentially be configured externally, allowing for easier updates and platform-specific optimizations without code changes.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsMeshShadersTier0);
	GET_SECTION_BOOL_HELPER(bSupportsMeshShadersTier1);
	GET_SECTION_BOOL_HELPER(bSupportsMeshShadersWithClipDistance);
	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);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsMeshShadersTier0 : 1;
	uint32 bSupportsMeshShadersTier1 : 1;
	uint32 bSupportsMeshShadersWithClipDistance : 1;
	uint32 MaxMeshShaderThreadGroupSize : 10;
	uint32 bRequiresUnwrappedMeshShaderArgs : 1;
	uint32 bSupportsPerPixelDBufferMask : 1;
	uint32 bIsHlslcc : 1;
	uint32 bSupportsDxc : 1; // Whether DirectXShaderCompiler (DXC) is supported
	uint32 bIsSPIRV : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsMeshShadersWithClipDistance

Source code excerpt:

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

	static FORCEINLINE_DEBUGGABLE const uint32 GetMaxMeshShaderThreadGroupSize(const FStaticShaderPlatform Platform)
	{
		check(IsValid(Platform));
		return Infos[Platform].MaxMeshShaderThreadGroupSize;