Metal · Apple graphics API

Also known as: Metal API

On this page 7

Metal is the Apple graphics API, a low-overhead programming interface that gives apps on macOS, iOS, iPadOS, tvOS and visionOS direct access to the GPU for 3D rendering, general-purpose compute and machine learning workloads. Apple introduced it in 2014 for iOS and brought it to the Mac in 2015, and it is now the only actively developed GPU interface on Apple platforms.

In the context of Apple silicon & compatibility, Metal is the layer that every graphics path eventually reaches. Native games, professional video apps, translation layers for Windows games and even the system user interface all submit their GPU work through Metal, which makes it central to how well software from other platforms runs on a Mac. Not to be confused with metal as a material or the Metal Performance Shaders library alone.

How the Metal API organizes GPU work

Metal reduces driver overhead by letting the app prepare expensive state ahead of time and then record lightweight commands. An app obtains an MTLDevice for the GPU, creates a command queue, fills command buffers with encoded work and commits them for execution, while the CPU continues with the next frame.

Shaders are written in the Metal Shading Language (MSL), a C++-based language, and compiled into an intermediate representation that the driver finalizes for the specific GPU. Rendering configuration is baked into pipeline state objects, so validation happens once at creation instead of on every draw call.

The table lists the core objects a Metal program works with.

ObjectPurposeTypical lifetime
MTLDeviceRepresents one GPU and creates resourcesWhole app session
Command queueOrders command buffers for the GPUWhole app session
Command bufferHolds encoded work for one submissionOne frame or task
Command encoderRecords render, compute or blit commandsPart of one command buffer
Pipeline state objectPrecompiled shaders and fixed stateCreated at load time
Buffer and textureHold vertex data, images and resultsAs long as the asset is used
Core objects of the Metal programming model

Metal versions and key features

Apple extends Metal in major feature releases tied to operating system versions and GPU families. Each release adds capabilities, but a feature is available only on GPUs that belong to a supported GPU family, so developers query support at run time.

ReleaseYearNotable additions
Metal2014Command buffers, MSL, precompiled pipelines
Metal 22017Argument buffers, GPU-driven rendering, external GPUs
Metal 32022MetalFX upscaling, mesh shaders, fast resource loading
Metal 42025New command model, machine learning in shaders, frame interpolation
Milestones in the evolution of Metal

Alongside the core API, Apple ships Metal Performance Shaders, a library of tuned kernels for image processing and neural networks, and MetalFX, which renders at a lower resolution and upscales the image to save GPU time. Frameworks such as Core ML and Core Image also run on Metal underneath.

Metal and Apple silicon GPUs

On Apple silicon, Metal is designed around a tile-based deferred rendering GPU and the unified memory architecture. Tile-based GPUs keep intermediate render data in fast on-chip tile memory, so Metal exposes features such as memoryless render targets and tile shaders that avoid writing temporary images to main memory.

Because the CPU and GPU share one pool of memory, a resource with shared storage mode can be read by both processors without copying. On Intel-based Macs with discrete graphics, the same data often had to be copied into separate video memory, which is why code tuned for Apple silicon frequently uses different storage modes.

  • Memoryless textures store depth or multisample data only in tile memory.
  • Shared storage suits data that the CPU updates every frame.
  • Private storage remains the best choice for static GPU-only assets.
  • Game Mode in macOS gives the active game higher priority for GPU and CPU time.

How Metal compares with other graphics APIs

Metal belongs to the same generation of explicit, low-overhead APIs as Vulkan and Direct3D 12, but it is exclusive to Apple platforms. Apple deprecated OpenGL and OpenCL in 2018, and they remain only for compatibility, without new features.

APIPlatformsStatus on the MacShader language
MetalApple platforms onlyNative and actively developedMetal Shading Language
VulkanWindows, Linux, AndroidThrough MoltenVK translationSPIR-V, often from GLSL
Direct3D 12Windows and XboxThrough translation layersHLSL
OpenGLMany platformsDeprecated, frozen at version 4.1GLSL
Metal compared with other graphics interfaces

This exclusivity explains why cross-platform software reaches the Mac through translation layers. MoltenVK maps Vulkan calls to Metal, while the Game Porting Toolkit and CrossOver translate Direct3D calls, and the Metal shader converter turns compiled HLSL shaders into Metal libraries.

Practical use, limitations and common mistakes

Most developers use Metal indirectly through engines such as Unity or Unreal Engine, which generate Metal code from their own renderers. Writing Metal directly pays off for custom renderers, compute pipelines and apps that need tight control over memory and latency.

The following table maps frequent mistakes to their effects and remedies.

MistakeEffectRemedy
Creating pipelines during gameplayVisible stutter on first useBuild pipeline states at load time
Waiting on the GPU every frameCPU and GPU run seriallyUse triple buffering with semaphores
Storing temporary targets in memoryWasted bandwidth on Apple GPUsUse memoryless render targets
Ignoring GPU family checksCrashes on older hardwareQuery feature support at run time
Common Metal mistakes and remedies

Metal has real limitations: there is no native Vulkan driver, translated games can lose performance to shader conversion overhead, and features differ across GPU families. Apple supplies Xcode GPU debugging tools and Metal System Trace in Instruments to diagnose such problems.

In simple terms

Metal is the language an app uses to talk to the graphics chip in a Mac, iPhone or iPad. When a game draws a scene or a video editor applies an effect, Metal carries those instructions to the GPU.

Picture a restaurant kitchen with a well-organized order system: the waiter writes complete tickets in advance, so the cooks never stop to ask questions. That is why Metal is fast. The main takeaway is that everything visual on a modern Apple device, including games made for Windows, ends up running through Metal.

A practical example

A small independent studio ports its Windows strategy game, originally built on Direct3D 12, to Macs with M-series chips. The team first runs the Windows build through the Game Porting Toolkit to estimate performance and finds a frame rate of about 35 frames per second at 1440p on a MacBook Pro.

For the native version, the studio switches its engine to the Metal backend, converts the HLSL shaders with the Metal shader converter and moves pipeline creation to the loading screen. It then enables MetalFX upscaling from 1080p to 1440p and uses memoryless depth buffers. The result is a steady 60 frames per second, shorter loading stutters and lower power draw, which lets the game run for noticeably longer on battery.