Metal (API)
Metal is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader application programming interface developed by Apple Inc., and which debuted in iOS 8. Metal combines functions similar to OpenGL and OpenCL under one API. It is intended to improve performance by offering low-level access to the GPU hardware for apps on iOS, iPadOS, macOS, and tvOS. It can be compared to low-level APIs on other platforms such as Vulkan and DirectX 12.
Metal is an object-oriented API that can be invoked using the Swift or Objective-C programming languages. Full-blown GPU execution is controlled via the Metal Shading Language. According to Apple promotional materials: "MSL is a single, unified language that allows tighter integration between the graphics and compute programs. Since MSL is C++-based, you will find it familiar and easy to use."
Features
Metal aims to provide low-overhead access to the GPU. Commands are encoded beforehand and then submitted to the GPU for asynchronous execution. The application controls when to wait for the execution to complete thus allowing application developers to increase throughput by encoding other commands while commands are executed on the GPU or save power by explicitly wait for GPU execution to complete. Additionally, command encoding is CPU independent thus applications can encode commands to each CPU thread independently. Lastly, render states are pre-computed beforehand, allowing the GPU driver to know in advance how to configure and optimize the render pipeline before command execution.Metal improves the capabilities of GPGPU programming by using compute shaders. Metal uses a specific shading language based on C++14; this is implemented using Clang and LLVM.
Metal offers application developers the flexibility where to create Metal resources. Resources can be allocated on the CPU, GPU, or both and provides facilities to update and synchronize allocated resources. Metal can also enforce a resource's state when during a command encoder's lifetime.
On macOS, Metal can provide application developers the discretion to specify which GPU to execute. Application developers can choose between the low-power integrated GPU of the CPU, the discrete GPU or an external GPU connected through Thunderbolt. Application developers also have the preference on how GPU commands are executed on which GPUs and provides suggestion on which GPU a certain command is most efficient to execute.
Metal Performance Shaders
Metal Performance Shaders is a highly optimized library of graphics functions that can help application developers achieve great performance at the same time decrease work on maintaining GPU family specific functions. It provides functions such as:- Image filtering algorithms
- Neural network processing
- Advance math operations
- Ray tracing
History
On June 5, 2017 at WWDC, Apple announced the second version of Metal, to be supported by macOS High Sierra, iOS 11 and tvOS 11. Metal 2 is not a separate API from Metal and is supported by the same hardware. Metal 2 enables more efficient profiling and debugging in Xcode, accelerated machine learning, lower CPU workload, support for virtual reality on macOS, and specificities of the Apple A11 GPU, in particular.
At the 2020 WWDC, Apple announced the migration of the Mac to Apple Silicon. Macs using Apple Silicon will feature Apple GPUs with a feature set combining what was previously available on macOS and iOS, and will be able to take advantage of features tailored to the tile based deferred rendering architecture of Apple GPUs.
Supported [GPUs]
On iOS, tvOS, and macOS, Metal supports Apple-designed SoCs from the Apple A7 or newer. On macOS, Metal also supports Intel HD and Iris Graphics from the HD 4000 series or newer, AMD GCN, and AMD RDNA GPUs. NVIDIA GPUs are supported but Metal drivers for newer devices are not available since macOS Mojave.Adoption
According to Apple, more than 148,000 applications use Metal directly, and 1.7 million use it through high-level frameworks, as of June 2017. macOS games using Metal for rendering are listed below.Title | Developer | Game engine | Release date | Notes |
Civilization VI | Aspyr | 24 October 2016 | Metal support since 5 April 2019 Bug: Windowed-mode only using Metal. May or may not be fixed in the future | |
' | Feral Interactive | 18 October 2013 | Metal support since 21 February 2019 | |
Dota 2 | Valve | Source 2 | The use of MoltenVK to support Metal via Vulkan was announced on. The option to use this became available on. | |
Quake 2 | id Software | Quake II engine | The original game using MoltenVK to support Metal via Vulkan was released to the public as vkQuake2. | |
Tomb Raider | Feral Interactive | Metal support with v1.2 in July 2019 | ||
Rise of the Tomb Raider | Feral Interactive | Foundation engine | Metal support shipping at launch | |
Shadow of the Tomb Raider | Feral Interactive | Foundation Engine | 2019 | Metal support shipping at launch |
F1 2016 | Feral Interactive | EGO Engine 4.0 | Metal support shipping at launch | |
Life is Strange 2 | Feral Interactive | Unreal Engine 4 | 2019 | Metal support shipping at launch |
Feral Interactive | Unity Engine | 13 September 2018 | Metal support shipping at launch | |
Larian Studios | Divinity Engine 2 | Metal support shipping at launch | ||
Company of Heroes 2 | Feral Interactive | Essence Engine 3 | Metal support since | |
Hitman | Feral Interactive | Metal support shipping at launch Not available on the Mac App Store. Steam and Feral Stores only. | ||
Sid Meier's Railroads! | Feral Interactive | Gamebryo | Metal support since | |
' | Feral Interactive | Essence Engine 4 | Metal support shipping at launch | |
' | Feral Interactive | Total War Engine 3 | Metal support shipping at launch | |
Feral Interactive | Total War Engine 3 | Metal support shipping at launch | ||
' | Feral Interactive | Total War Engine 3 | Metal support shipping at launch | |
' | Feral Interactive | Total War Engine 2 | Metal support since 25 October 2018 | |
' | Feral Interactive | Metal support since 16th December 2019 | ||
' | Feral Interactive | Metal support since 25th of October 2019 with v1.2 | ||
' | Feral Interactive | Metal support since 4th of October 2019 | ||
' | Feral Interactive | Metal support since 4th of October 2019 | ||
' | Feral Interactive | Unreal Engine 2.5 | Metal support shipping at launch | |
F1 2017 | Feral Interactive | EGO Engine 4.0 | Metal support shipping at launch | |
' | Feral Interactive | Dawn Engine | Metal support shipping at launch | |
DiRT Rally | Feral Interactive | EGO Engine 2.5 | Metal support shipping at launch | |
Ballistic Overkill | Aquiris Game Studio | Unity Engine 5 | Metal support shipping at launch | |
BattleTech | Harebrained Schemes | Unity Engine 5 | Metal support shipping at launch | |
Mafia III | Aspyr Media | Illusion Engine | Metal support shipping at launch | |
World of Warcraft | Blizzard Entertainment | WoW Engine | Metal support since August 2016 | |
StarCraft II | Blizzard Entertainment | SC2 Engine | Metal support in beta since | |
Heroes of the Storm | Blizzard Entertainment | SC2 Engine | Metal support in beta since, on | |
Fortnite | Epic Games | Unreal Engine 4 | Metal support shipping at launch | |
Obduction | Cyan Worlds | Unreal Engine 4 | Metal support shipping at launch | |
Everspace | Rockfish | Unreal Engine 4 | Metal support shipping at launch | |
' | Studio Wildcard | Unreal Engine 4 | Metal support shipping at launch | |
Observer | Bloober Team | Unreal Engine 4 | Metal support shipping at launch | |
Unreal Tournament | Epic Games | Unreal Engine 4 | Metal support since January 2017 | |
Refunct | Dominique Grieshofer | Unreal Engine 4 | Metal support shipping at launch | |
' | Paradox Interactive | Unity Engine 5 | Metal support since | |
Universe Sandbox 2 | Giant Army | Unity Engine 5 | Metal support in beta since June 2017 | |
War Thunder | Gaijin Entertainment | Dagor Engine 4 | Metal support added, removed at some point in 2018 | |
The Witness | Thekla, Inc | Thekla Engine | Metal support shipping at launch | |
Micro Machines World Series | Virtual Programming | Unity Engine 5 | Metal support shipping at launch | |
' | Telltale Games | Telltale Tool | Metal support shipping at launch | |
' | Telltale Games | Telltale Tool | Metal support shipping at launch | |
' | Telltale Games | Telltale Tool | Metal support shipping at launch | |
ARMA 3 | Virtual Programming | Real Virtuality | Metal support in beta since | |
MXGP3 | Virtual Programming | Unreal Engine 4 | Metal support shipping at launch | |
Gravel | Virtual Programming | Unreal Engine 4 | Metal support shipping at launch | |
X-Plane 11 | Laminar Research | Custom engine | Metal support in public beta. | |
Headlander | Double Fine Productions | Buddha Engine | Metal support shipping at launch | |
The Sims 4 | Maxis | Custom engine | Metal support added |