bSupportsRenderTargetWriteMask

bSupportsRenderTargetWriteMask

#Overview

name: bSupportsRenderTargetWriteMask

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

#Summary

#Usage in the C++ source code

The purpose of bSupportsRenderTargetWriteMask is to indicate whether a specific shader platform supports render target write masks. This feature allows for selective writing to specific color channels of a render target, providing more control over rendering output.

This setting variable is primarily used within the RHI (Rendering Hardware Interface) subsystem of Unreal Engine. It’s part of the FGenericDataDrivenShaderPlatformInfo class, which manages shader platform capabilities.

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

bSupportsRenderTargetWriteMask interacts with other shader platform capability flags, such as bSupportsShaderRootConstants and bSupportsShaderBundleDispatch. These flags collectively define the features and capabilities of a given shader platform.

Developers must be aware that this variable’s value can vary across different shader platforms. It’s crucial to check this capability before attempting to use render target write masks in shaders or rendering code.

Best practices when using this variable include:

  1. Always check the value using GetSupportsRenderTargetWriteMask before assuming the feature is available.
  2. Consider providing fallback rendering paths for platforms that don’t support render target write masks.
  3. Be aware that this capability might be forcibly disabled in preview platforms, as seen in the UpdatePreviewPlatforms function.
  4. Use this information to optimize rendering code, potentially improving performance on platforms that support this feature.

#Setting Variables

#References In INI files

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

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	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);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracingCallableShaders);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracingProceduralPrimitive);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracingTraversalStatistics);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms

Source code excerpt:

				PREVIEW_FORCE_DISABLE(bSupportsShaderRootConstants);
				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:44

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsShaderRootConstants : 1;
	uint32 bSupportsShaderBundleDispatch : 1;
	uint32 bSupportsRenderTargetWriteMask : 1;
	uint32 bSupportsRayTracing : 1;
	uint32 bSupportsRayTracingCallableShaders : 1;
	uint32 bSupportsRayTracingProceduralPrimitive : 1;
	uint32 bSupportsRayTracingTraversalStatistics : 1;
	uint32 bSupportsRayTracingIndirectInstanceData : 1; // Whether instance transforms can be copied from the GPU to the TLAS instances buffer
	uint32 bSupportsHighEndRayTracingEffects : 1; // Whether fully-featured RT effects can be used on the platform (with translucent shadow, etc.)

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsRenderTargetWriteMask

Source code excerpt:

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

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