bSupportsInstancedStereo

bSupportsInstancedStereo

#Overview

name: bSupportsInstancedStereo

The value of this variable can be defined or overridden in .ini config files. 7 .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 bSupportsInstancedStereo is to indicate whether a particular shader platform supports instanced stereo rendering. This is a technique used in virtual reality (VR) applications to optimize rendering for both eyes simultaneously.

bSupportsInstancedStereo is primarily used within the Rendering Hardware Interface (RHI) subsystem of Unreal Engine. It’s 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, specifically in the ParseDataDrivenShaderInfo function. It’s likely populated from a configuration file or system that defines shader platform capabilities.

This variable interacts with other VR-related variables, such as bSupportsMobileMultiView. In the UpdatePreviewPlatforms function, we can see that the value of bSupportsInstancedStereo is adjusted based on the runtime support for mobile multi-view.

Developers must be aware that this variable is platform-specific and its value can affect VR rendering performance and compatibility. It’s crucial to ensure that the value accurately reflects the capabilities of the target hardware.

Best practices when using this variable include:

  1. Checking its value before attempting to use instanced stereo rendering techniques.
  2. Considering fallback rendering methods for platforms that don’t support instanced stereo.
  3. Testing VR applications on a variety of platforms to ensure correct behavior based on this setting.
  4. Being aware of how this setting interacts with other VR-related settings, especially on mobile platforms.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:47, section: [ShaderPlatform METAL_SM5]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:87, section: [ShaderPlatform METAL_SM6]

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

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

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:66, section: [ShaderPlatform PCD3D_SM5]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:125, section: [ShaderPlatform PCD3D_SM6]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:155, section: [ShaderPlatform PCD3D_ES3_1]

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_BOOL_HELPER(bSupportsPercentageCloserShadows);
	GET_SECTION_BOOL_HELPER(bSupportsIndexBufferUAVs);
	GET_SECTION_BOOL_HELPER(bSupportsInstancedStereo);
	GET_SECTION_SUPPORT_HELPER(SupportsMultiViewport);
	GET_SECTION_BOOL_HELPER(bSupportsMSAA);
	GET_SECTION_BOOL_HELPER(bSupports4ComponentUAVReadWrite);
	GET_SECTION_BOOL_HELPER(bSupportsShaderRootConstants);
	GET_SECTION_BOOL_HELPER(bSupportsShaderBundleDispatch);
	GET_SECTION_BOOL_HELPER(bSupportsRenderTargetWriteMask);

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::UpdatePreviewPlatforms

Source code excerpt:

				if (PreviewInfo.bSupportsMobileMultiView && !RuntimeInfo.bSupportsMobileMultiView)
				{
					PREVIEW_USE_RUNTIME_VALUE(bSupportsInstancedStereo);
					PREVIEW_USE_RUNTIME_VALUE(bSupportsVertexShaderLayer);
				}
				else
				{
					PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsInstancedStereo);
				}

				// Settings that should be kept true if the runtime also supports it.
				PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsNanite);
				PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsLumenGI);
				PREVIEW_DISABLE_IF_RUNTIME_UNSUPPORTED(bSupportsPrimitiveShaders);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsPercentageCloserShadows : 1;
	uint32 bSupportsIndexBufferUAVs : 1;
	uint32 bSupportsInstancedStereo : 1;
	uint32 SupportsMultiViewport : int32(ERHIFeatureSupport::NumBits);
	uint32 bSupportsMSAA : 1;
	uint32 bSupports4ComponentUAVReadWrite : 1;
	uint32 bSupportsShaderRootConstants : 1;
	uint32 bSupportsShaderBundleDispatch : 1;
	uint32 bSupportsRenderTargetWriteMask : 1;

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsInstancedStereo

Source code excerpt:

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

	static FORCEINLINE_DEBUGGABLE const ERHIFeatureSupport GetSupportsMultiViewport(const FStaticShaderPlatform Platform)
	{
		check(IsValid(Platform));
		return ERHIFeatureSupport(Infos[Platform].SupportsMultiViewport);