bSupportsRealTypes

bSupportsRealTypes

#Overview

name: bSupportsRealTypes

The value of this variable can be defined or overridden in .ini config files. 3 .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 bSupportsRealTypes is to indicate whether a specific shader platform supports real number types in shaders. This setting variable is primarily used in the rendering system of Unreal Engine 5, specifically for shader compilation and platform-specific feature support.

The Unreal Engine subsystem that relies on this setting variable is the RHI (Rendering Hardware Interface) module. This can be seen from the file paths where the variable is referenced, all within the RHI directory.

The value of this variable is set in the FGenericDataDrivenShaderPlatformInfo class, which is part of the data-driven shader platform information system. It’s populated during the parsing of shader platform information, as seen in the ParseDataDrivenShaderInfo function.

This variable interacts with other shader platform capabilities and features, such as bSupportsROV, bSupportsOIT, and EnablesHLSL2021ByDefault. It’s part of a larger set of flags that describe the capabilities of a shader platform.

Developers must be aware that this variable is platform-specific and its value may vary depending on the target hardware and graphics API. It’s 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 the support level using the GetSupportsRealTypes function before attempting to use real types in shaders.
  2. Consider providing fallback implementations for platforms that don’t support real types or have limited support.
  3. Be aware of performance implications when using real types, even on platforms that support them.
  4. Use this information in conjunction with other platform capabilities to make informed decisions about shader implementation strategies.
  5. Keep in mind that this is part of a data-driven system, so values may change based on the platform configuration without requiring code changes.

#Setting Variables

#References In INI files

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

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

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsROV);
	GET_SECTION_BOOL_HELPER(bSupportsOIT);
	GET_SECTION_SUPPORT_HELPER(bSupportsRealTypes);
	GET_SECTION_INT_HELPER(EnablesHLSL2021ByDefault);
	GET_SECTION_BOOL_HELPER(bSupportsSceneDataCompressedTransforms);
	GET_SECTION_BOOL_HELPER(bSupportsSwapchainUAVs);
	GET_SECTION_BOOL_HELPER(bSupportsClipDistance);
	GET_SECTION_BOOL_HELPER(bSupportsNNEShaders);
	GET_SECTION_BOOL_HELPER(bSupportsShaderPipelines);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms

Source code excerpt:

				PREVIEW_USE_RUNTIME_VALUE(bSupportsVertexShaderSRVs);
				PREVIEW_USE_RUNTIME_VALUE(bSupportsManualVertexFetch);
				PREVIEW_USE_RUNTIME_VALUE(bSupportsRealTypes);
				PREVIEW_USE_RUNTIME_VALUE(bSupportsUniformBufferObjects);

				// Settings that will never be supported in preview
				PREVIEW_FORCE_DISABLE(bSupportsShaderRootConstants);
				PREVIEW_FORCE_DISABLE(bSupportsShaderBundleDispatch);
				PREVIEW_FORCE_DISABLE(bSupportsRenderTargetWriteMask);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsROV : 1;
	uint32 bSupportsOIT : 1;
	uint32 bSupportsRealTypes : int32(ERHIFeatureSupport::NumBits);
	uint32 EnablesHLSL2021ByDefault : 2; // 0: disabled, 1: global shaders only, 2: all shaders
	uint32 bSupportsSceneDataCompressedTransforms : 1;
	uint32 bIsPreviewPlatform : 1;
	uint32 bSupportsSwapchainUAVs : 1;
	uint32 bSupportsClipDistance : 1;
	uint32 bSupportsNNEShaders: 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const ERHIFeatureSupport GetSupportsRealTypes

Source code excerpt:

	static FORCEINLINE_DEBUGGABLE const ERHIFeatureSupport GetSupportsRealTypes(const FStaticShaderPlatform Platform)
	{
		return ERHIFeatureSupport(Infos[Platform].bSupportsRealTypes);
	}

	static FORCEINLINE_DEBUGGABLE const uint32 GetEnablesHLSL2021ByDefault(const FStaticShaderPlatform Platform)
	{
		return Infos[Platform].EnablesHLSL2021ByDefault;
	}