Metal

Apple's low-overhead API for graphics, compute and machine learning on the GPU.

Introduced
2014
WWDC14
Kind
Framework
Runs on
Get it from
iOS
8.0+
iPadOS
8.0+
Mac Catalyst
13.0+
macOS
10.11+
tvOS
9.0+
visionOS
1.0+
watchOS
Works in Swift Playground ›

Overview

Metal gives games and pro apps direct, efficient control of Apple GPUs, with a C++-based shading language and tight integration between graphics and compute. It's the foundation under SwiftUI, Core Animation, RealityKit and Core ML.

Metal 4 adds machine learning right inside shaders and command buffers, while MetalFX upscales, interpolates frames and denoises to keep frame rates high.

Metal 4

Machine learning inside shaders and command buffers.

MetalFX

Upscaling, frame interpolation and denoising.

Ray tracing

Hardware-accelerated on the latest Apple GPUs.

Developer tools

Metal debugger, performance HUD and Instruments.

Renderer.swift
import Metal guard let device = MTLCreateSystemDefaultDevice(), let queue = device.makeCommandQueue(), let library = device.makeDefaultLibrary() else { fatalError("Metal is not supported") } let function = library.makeFunction(name: "brighten")! let pipeline = try device.makeComputePipelineState(function: function) let commands = queue.makeCommandBuffer()! let encoder = commands.makeComputeCommandEncoder()! encoder.setComputePipelineState(pipeline) // set textures, then dispatch threads encoder.endEncoding() commands.commit()

History

How it grew up.

2014

Introduced

Metal debuts on iOS 8.

2015

Mac

Metal comes to OS X El Capitan.

2017

Metal 2

Faster and more GPU-driven.

2018

OpenGL deprecated

OpenGL is deprecated in favor of Metal in iOS 12 and macOS Mojave.

2022

Metal 3

MetalFX upscaling and mesh shaders.

2025

Metal 4

Machine learning and a new command model.

Watch and learn