bSupportsMSAA

bSupportsMSAA

#Overview

name: bSupportsMSAA

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 bSupportsMSAA is to indicate whether the current rendering platform supports Multi-Sample Anti-Aliasing (MSAA). MSAA is a technique used to improve image quality by reducing aliasing artifacts in rendered graphics.

This setting variable is primarily used in the Rendering Hardware Interface (RHI) subsystem of Unreal Engine 5. Specifically, it’s part of the DataDrivenShaderPlatformInfo module, which provides information about shader platform capabilities.

The value of this variable is set in multiple places:

  1. It’s initialized to true in the FGenericDataDrivenShaderPlatformInfo::SetDefaultValues function.
  2. It can be overridden by parsing data-driven shader info in the FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo function.

This variable interacts with other platform-specific capabilities and features within the FGenericDataDrivenShaderPlatformInfo class, such as bSupportsInstancedStereo, SupportsMultiViewport, and bSupports4ComponentUAVReadWrite.

Developers must be aware that this variable’s value can vary depending on the target platform. While it’s set to true by default, it may be overridden for specific platforms that don’t support MSAA.

Best practices when using this variable include:

  1. Always check its value using the GetSupportsMSAA function before attempting to use MSAA in your rendering code.
  2. Be prepared to provide alternative anti-aliasing methods for platforms where MSAA is not supported.
  3. Consider the performance implications of enabling MSAA, especially on lower-end devices.
  4. Use this variable in conjunction with other platform-specific capabilities to make informed decisions about graphics quality settings in your game.

#Setting Variables

#References In INI files

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

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::SetDefaultValues

Source code excerpt:

{
	MaxFeatureLevel = ERHIFeatureLevel::Num;
	bSupportsMSAA = true;
	bSupportsDOFHybridScattering = true;
	bSupportsHZBOcclusion = true;
	bSupportsWaterIndirectDraw = true;
	bSupportsAsyncPipelineCompilation = true;
	bSupportsVertexShaderSRVs = true; // Explicitly overriden to false for ES 3.1 platforms via DDPI ini
	bSupportsManualVertexFetch = true;

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

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	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);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracing);
	GET_SECTION_BOOL_HELPER(bSupportsRayTracingShaders);

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

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

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

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetSupportsMSAA

Source code excerpt:

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

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