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:
Metal has been available since June 2, 2014 on iOS devices powered by Apple A7 or later, and since June 8, 2015 on Macs running OS X El Capitan.
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.
TitleDeveloper Game engineRelease date Notes
Civilization VIAspyr24 October 2016Metal support since 5 April 2019
Bug: Windowed-mode only using Metal. May or may not be fixed in the future
'Feral Interactive18 October 2013Metal support since 21 February 2019
Dota 2ValveSource 2The use of MoltenVK to support Metal via Vulkan was announced on. The option to use this became available on.
Quake 2id SoftwareQuake II engineThe original game using MoltenVK to support Metal via Vulkan was released to the public as vkQuake2.
Tomb Raider Feral InteractiveMetal support with v1.2 in July 2019
Rise of the Tomb RaiderFeral InteractiveFoundation engineMetal support shipping at launch
Shadow of the Tomb RaiderFeral InteractiveFoundation Engine2019Metal support shipping at launch
F1 2016Feral InteractiveEGO Engine 4.0Metal support shipping at launch
Life is Strange 2Feral InteractiveUnreal Engine 42019Metal support shipping at launch
Feral InteractiveUnity Engine13 September 2018Metal support shipping at launch
Larian StudiosDivinity Engine 2Metal support shipping at launch
Company of Heroes 2Feral InteractiveEssence Engine 3Metal support since
Hitman Feral InteractiveMetal support shipping at launch
Not available on the Mac App Store. Steam and Feral Stores only.
Sid Meier's Railroads!Feral InteractiveGamebryoMetal support since
'Feral InteractiveEssence Engine 4Metal support shipping at launch
'Feral InteractiveTotal War Engine 3Metal support shipping at launch
Feral InteractiveTotal War Engine 3Metal support shipping at launch
'Feral InteractiveTotal War Engine 3Metal support shipping at launch
'Feral InteractiveTotal War Engine 2Metal support since 25 October 2018
'Feral InteractiveMetal support since 16th December 2019
'Feral InteractiveMetal support since 25th of October 2019 with v1.2
'Feral InteractiveMetal support since 4th of October 2019
'Feral InteractiveMetal support since 4th of October 2019
'Feral InteractiveUnreal Engine 2.5Metal support shipping at launch
F1 2017Feral InteractiveEGO Engine 4.0Metal support shipping at launch
'Feral InteractiveDawn EngineMetal support shipping at launch
DiRT RallyFeral InteractiveEGO Engine 2.5Metal support shipping at launch
Ballistic OverkillAquiris Game StudioUnity Engine 5Metal support shipping at launch
BattleTechHarebrained SchemesUnity Engine 5Metal support shipping at launch
Mafia IIIAspyr MediaIllusion EngineMetal support shipping at launch
World of WarcraftBlizzard EntertainmentWoW EngineMetal support since August 2016
StarCraft IIBlizzard EntertainmentSC2 EngineMetal support in beta since
Heroes of the StormBlizzard EntertainmentSC2 EngineMetal support in beta since,
on
FortniteEpic GamesUnreal Engine 4Metal support shipping at launch
ObductionCyan WorldsUnreal Engine 4Metal support shipping at launch
EverspaceRockfishUnreal Engine 4Metal support shipping at launch
'Studio WildcardUnreal Engine 4Metal support shipping at launch
ObserverBloober TeamUnreal Engine 4Metal support shipping at launch
Unreal TournamentEpic GamesUnreal Engine 4Metal support since January 2017
RefunctDominique GrieshoferUnreal Engine 4Metal support shipping at launch
'Paradox InteractiveUnity Engine 5Metal support since
Universe Sandbox 2Giant ArmyUnity Engine 5Metal support in beta since June 2017
War ThunderGaijin EntertainmentDagor Engine 4Metal support added, removed at some point in 2018
The WitnessThekla, IncThekla EngineMetal support shipping at launch
Micro Machines World SeriesVirtual ProgrammingUnity Engine 5Metal support shipping at launch
'Telltale GamesTelltale ToolMetal support shipping at launch
'Telltale GamesTelltale ToolMetal support shipping at launch
'Telltale GamesTelltale ToolMetal support shipping at launch
ARMA 3Virtual ProgrammingReal VirtualityMetal support in beta since
MXGP3Virtual ProgrammingUnreal Engine 4Metal support shipping at launch
GravelVirtual ProgrammingUnreal Engine 4Metal support shipping at launch
X-Plane 11Laminar ResearchCustom engineMetal support in public beta.
HeadlanderDouble Fine ProductionsBuddha EngineMetal support shipping at launch
The Sims 4MaxisCustom engineMetal support added