Metal is a low-level, low-overhead
hardware-accelerated 3D graphic
3D computer graphics, sometimes called Computer-generated imagery, CGI, 3D-CGI or three-dimensional Computer-generated imagery, computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian coor ...
and
compute shader
In computing, a compute kernel is a routine compiled for high throughput accelerators (such as graphics processing units (GPUs), digital signal processors (DSPs) or field-programmable gate arrays (FPGAs)), separate from but used by a main pro ...
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
created by
Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
, debuting in
iOS 8. Metal combines functions similar to
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
and
OpenCL
OpenCL (Open Computing Language) is a software framework, framework for writing programs that execute across heterogeneous computing, heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), di ...
in one API. It is intended to improve performance by offering low-level access to the GPU hardware for apps on
iOS
Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
,
iPadOS
iPadOS is a mobile operating system developed by Apple for its iPad line of tablet computers. It was given a name distinct from iOS, the operating system used by Apple's iPhones to reflect the diverging features of the two product lines, suc ...
,
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, and
tvOS
tvOS (formerly Apple TV Software) is an operating system developed by Apple for the Apple TV, a digital media player. In the first-generation Apple TV, Apple TV Software was based on Mac OS X. The software for the second-generation and later ...
. It can be compared to low-level APIs on other
platforms such as
Vulkan and
DirectX 12.
Metal is an
object-oriented
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
API that can be invoked using the
Swift
Swift or SWIFT most commonly refers to:
* SWIFT, an international organization facilitating transactions between banks
** SWIFT code
* Swift (programming language)
* Swift (bird), a family of birds
It may also refer to:
Organizations
* SWIF ...
,
Objective-C
Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was ...
or
C++17
C17, C-17 or C.17 may refer to:
Transportation
* , a 1917 British C-class submarine
Air
* Boeing C-17 Globemaster III, a military transport aircraft
* Lockheed Y1C-17 Vega, a six-passenger monoplane
* Cierva C.17, a 1928 English experimental ...
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s. Full-blown GPU execution is controlled via the Metal Shading Language. According to Apple promotional materials: "MSL ''
etal Shading Language' 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 waiting 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
General-purpose computing on graphics processing units (GPGPU, or less often GPGP) is the use of a graphics processing unit (GPU), which typically handles computation only for computer graphics, to perform computation in applications traditiona ...
programming by using
compute shader
In computing, a compute kernel is a routine compiled for high throughput accelerators (such as graphics processing units (GPUs), digital signal processors (DSPs) or field-programmable gate arrays (FPGAs)), separate from but used by a main pro ...
s. Metal uses a specific
shading language based on
C++14
C14, C.XIV or C-14 may refer to:
Time
* The 14th century
* Carbon-14, a radioactive isotope of carbon
** Radiocarbon dating, C-14 dating, a method for dating events
Science
* IEC 60320#C14, IEC 60320 C14, a polarised, three pole socket electrical ...
, implemented using
Clang
Clang () is a compiler front end for the programming languages C, C++, Objective-C, Objective-C++, and the software frameworks OpenMP, OpenCL, RenderScript, CUDA, SYCL, and HIP. It acts as a drop-in replacement for the GNU Compiler ...
and
LLVM
LLVM, also called LLVM Core, is a target-independent optimizer and code generator. It can be used to develop a Compiler#Front end, frontend for any programming language and a Compiler#Back end, backend for any instruction set architecture. LLVM i ...
.
Metal allows application developers to create Metal resources such as buffers, textures. 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 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 (on certain MacBooks and Macs) 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 (commands to render a scene can be executed by the discrete GPU while post-processing and display can be handled by the integrated GPU).
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 including:
* Image filtering algorithms
* Neural network processing
* Advanced math operations
* Ray tracing
History
Metal has been available since June 2, 2014 on
iOS devices powered by
Apple A7 or later, and since June 8, 2015 on
Macs (2012 models or later) running
OS X El Capitan
OS X El Capitan ( ) () is the twelfth major release of macOS (named OS X at the time of El Capitan's release), Apple Inc.'s desktop and server operating system for Macintosh. It focuses mainly on performance, stability, and security. Followi ...
.
On June 5, 2017, at
WWDC, Apple announced the second version of Metal, to be supported by
macOS High Sierra,
iOS 11
iOS 11 is the iOS version history, eleventh major release of the iOS mobile operating system developed by Apple Inc., Apple, being the successor to iOS 10. It was announced at the company's Worldwide Developers Conference on June 5, 2017, and w ...
and
tvOS 11
tvOS (formerly Apple TV Software) is an operating system developed by Apple for the Apple TV, a digital media player. In the first-generation Apple TV, Apple TV Software was based on Mac OS X. The software for the second-generation and later ...
. 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 engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs.
For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
in
Xcode
Xcode is a suite of developer tools for building apps on Apple devices. It includes an integrated development environment (IDE) of the same name for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, tvOS, and visionOS. It w ...
, accelerated
machine learning
Machine learning (ML) is a field of study in artificial intelligence concerned with the development and study of Computational statistics, statistical algorithms that can learn from data and generalise to unseen data, and thus perform Task ( ...
, lower
CPU workload, support for
virtual reality
Virtual reality (VR) is a Simulation, simulated experience that employs 3D near-eye displays and pose tracking to give the user an immersive feel of a virtual world. Applications of virtual reality include entertainment (particularly video gam ...
on macOS, and specificities of the
Apple A11
The Apple A11 Bionic is a 64-bit ARM-based system on a chip (SoC) designed by Apple Inc., part of the Apple silicon series, and manufactured by TSMC. It was only used in the iPhone 8 and 8 Plus, and iPhone X which were introduced on Septemb ...
GPU, in particular.
At the 2020
WWDC, Apple announced the migration of the Mac to
Apple silicon
Apple silicon is a series of system on a chip (SoC) and system in a package (SiP) processors designed by Apple Inc., mainly using the ARM architecture family, ARM architecture. They are used in nearly all of the company's devices including Mac ...
. 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 (TBDR) architecture of Apple GPUs.
At the 2022
WWDC, Apple announced the third version of Metal (Metal 3), which would debut with the release of
macOS Ventura,
iOS 16
iOS 16 is the iOS version history, sixteenth major release of Apple Inc., Apple's iOS mobile operating system for the iPhone. It is the successor of iOS 15, and was announced at the company's Worldwide Developers Conference (WWDC) on June 6, 202 ...
and
iPadOS 16. Metal 3 introduces the MetalFX upscaling framework, which renders complex scenes in less time per frame with high-performance upscaling and anti-aliasing, mesh shaders support. Also announced possibility to use C/C++ for Metal API.
Supported GPUs
The first version of Metal supports the following hardware and software:
*
Apple A7 SoC or later with
iOS 8 or later
*
Apple M1 SoC or later with
macOS 11 or later
* Intel Processor with
Intel HD and Iris Graphics
Intel Graphics Technology (GT) is the collective name for a series of Integrated GPU, integrated graphics processors (IGPs) produced by Intel that are manufactured on the same Semiconductor package, package or Die (integrated circuit), die as the ...
Ivy Bridge series or later with
OS X 10.11 or later
* AMD Graphics with
GCN or
RDNA architecture with
OS X 10.11 or later
* NVIDIA Graphics with
Kepler
Johannes Kepler (27 December 1571 – 15 November 1630) was a German astronomer, mathematician, astrologer, natural philosopher and writer on music. He is a key figure in the 17th-century Scientific Revolution, best known for his laws of p ...
architecture with
OS X 10.11 to
macOS 11 operating system
* NVIDIA Graphics with
Maxwell
Maxwell may refer to:
People
* Maxwell (surname), including a list of people and fictional characters with the name
** James Clerk Maxwell, mathematician and physicist
* Justice Maxwell (disambiguation)
* Maxwell baronets, in the Baronetage of N ...
architecture or
Pascal architecture with
OS X 10.11 to
macOS 10.13 operating system
The second version of Metal supports the following hardware and software:
*
Apple A7 SoC or later with
iOS 11
iOS 11 is the iOS version history, eleventh major release of the iOS mobile operating system developed by Apple Inc., Apple, being the successor to iOS 10. It was announced at the company's Worldwide Developers Conference on June 5, 2017, and w ...
or later
*
Apple M1 SoC or later with
macOS 11 or later
* Intel Processor with
Intel HD and Iris Graphics
Intel Graphics Technology (GT) is the collective name for a series of Integrated GPU, integrated graphics processors (IGPs) produced by Intel that are manufactured on the same Semiconductor package, package or Die (integrated circuit), die as the ...
Skylake series or later with
macOS 10.13 or later
* AMD Graphics with
GCN or
RDNA architecture with
macOS 10.13 or later
The third version of Metal supports the following hardware and software:
*
Apple A13 or later with
iOS 16
iOS 16 is the iOS version history, sixteenth major release of Apple Inc., Apple's iOS mobile operating system for the iPhone. It is the successor of iOS 15, and was announced at the company's Worldwide Developers Conference (WWDC) on June 6, 202 ...
,
iPadOS 16
*
Apple A14
The Apple A14 Bionic is a 64-bit computing, 64-bit ARMv8.4-A system on a chip, system on a chip (SoC) designed by Apple Inc., part of the Apple silicon series. It appears in the iPad Air (4th generation) and iPad (10th generation), as well as iP ...
or later with
iOS 16
iOS 16 is the iOS version history, sixteenth major release of Apple Inc., Apple's iOS mobile operating system for the iPhone. It is the successor of iOS 15, and was announced at the company's Worldwide Developers Conference (WWDC) on June 6, 202 ...
,
iPadOS 16 or later
*
Apple M1 SoC or later with
iPadOS 16 or later
*
Apple M1 SoC or later with
macOS 13 or later
* Intel Processor with
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
UHD 630 or Iris Plus (Kaby Lake or later) with
macOS 13 or later
* AMD Graphics with
RDNA architecture (5000 and 6000 series) and Pro Vega (5th generation
GCN architecture)
The fourth version of Metal supports the following hardware and software:
*
Apple A14
The Apple A14 Bionic is a 64-bit computing, 64-bit ARMv8.4-A system on a chip, system on a chip (SoC) designed by Apple Inc., part of the Apple silicon series. It appears in the iPad Air (4th generation) and iPad (10th generation), as well as iP ...
or later with
iOS 26,
iPadOS 26 or later
*
Apple M1 SoC or later with
iPadOS 26,
macOS 26 or later
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.
See also
*
Direct3D
Direct3D is a graphics application programming interface (API) for Microsoft Windows. Part of DirectX, Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D uses hardware ...
–
DirectX 12 introduces low-level APIs.
*
Mantle – low-level API by
AMD
Advanced Micro Devices, Inc. (AMD) is an American multinational corporation and technology company headquartered in Santa Clara, California and maintains significant operations in Austin, Texas. AMD is a hardware and fabless company that de ...
*
Vulkan – low-overhead successor to OpenGL
*
MoltenVK - software compatibility library to run Vulkan software on top of the Metal API
*
WebGPU
*
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
- cross-platform graphics API
References
External links
Metal for Developers(preliminary)
WWDC14 demoextended versionInstall macOS 10.14 Mojave on Mac Pro (Mid 2010) and Mac Pro (Mid 2012)- Apple article explaining what GPUs are compatible with Apple's Metal APIs on Mac OS 10.14 (Mojave) operating system
{{iOS
2014 software
3D graphics APIs
Apple Inc. developed frameworks
Graphics libraries
IOS