bIsMetalMRT
bIsMetalMRT
#Overview
name: bIsMetalMRT
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bIsMetalMRT is to indicate whether the current shader platform supports Metal Multiple Render Targets (MRT). This setting is specifically related to the rendering system in Unreal Engine 5, particularly for Metal-based platforms such as iOS and macOS.
This setting variable is primarily used within the RHI (Rendering Hardware Interface) module of Unreal Engine. It’s part of the FGenericDataDrivenShaderPlatformInfo class, which provides information about various shader platforms.
The value of this variable is set during the parsing of shader platform information, likely from a configuration file. This can be seen in the ParseDataDrivenShaderInfo function where it’s being read using the GET_SECTION_BOOL_HELPER macro.
bIsMetalMRT interacts with other platform-specific boolean flags like bIsMobile, bIsPC, bIsConsole, and bIsAndroidOpenGLES. These flags collectively define the characteristics of a particular shader platform.
Developers must be aware that this variable is platform-specific and should only be used when dealing with Metal-based rendering, particularly on iOS or macOS platforms. Incorrect usage or assumptions about this flag on non-Metal platforms could lead to rendering errors or performance issues.
Best practices when using this variable include:
- Always check the platform before relying on this flag.
- Use the provided static function GetIsMetalMRT(Platform) instead of accessing the variable directly, as it ensures proper platform validation.
- Consider this flag in conjunction with other platform characteristics when optimizing rendering code for Metal platforms.
- Be cautious when making assumptions about MRT support based solely on this flag, as actual capabilities may vary depending on the specific device and iOS/macOS version.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:65, section: [ShaderPlatform METAL_MRT]
- INI Section:
ShaderPlatform METAL_MRT
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:117, section: [ShaderPlatform METAL_MRT_MAC]
- INI Section:
ShaderPlatform METAL_MRT_MAC
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/TVOS/DataDrivenPlatformInfo.ini:23, section: [ShaderPlatform METAL_MRT_TVOS]
- INI Section:
ShaderPlatform METAL_MRT_TVOS
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:17, section: [ShaderPlatform VULKAN_SM5]
- INI Section:
ShaderPlatform VULKAN_SM5
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:148, section: [ShaderPlatform VULKAN_SM6]
- INI Section:
ShaderPlatform VULKAN_SM6
- Raw value:
false
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:199
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
GET_SECTION_BOOL_HELPER(bIsMobile);
GET_SECTION_BOOL_HELPER(bIsMetalMRT);
GET_SECTION_BOOL_HELPER(bIsPC);
GET_SECTION_BOOL_HELPER(bIsConsole);
GET_SECTION_BOOL_HELPER(bIsAndroidOpenGLES);
GET_SECTION_BOOL_HELPER(bSupportsDebugViewShaders);
GET_SECTION_BOOL_HELPER(bSupportsMobileMultiView);
GET_SECTION_BOOL_HELPER(bSupportsArrayTextureCompression);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:24
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 ShaderPropertiesHash;
uint32 bIsMobile : 1;
uint32 bIsMetalMRT : 1;
uint32 bIsPC : 1;
uint32 bIsConsole : 1;
uint32 bIsAndroidOpenGLES : 1;
uint32 bSupportsDebugViewShaders : 1;
uint32 bSupportsMobileMultiView : 1;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:209
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetIsMetalMRT
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bIsMetalMRT;
}
static FORCEINLINE_DEBUGGABLE const bool GetIsPC(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bIsPC;