Basic Tasks and Concepts

Get familiar with Metal through a series of sample code projects.


These sample code projects teach fundamental concepts used in Metal apps. Each project builds on the previous project, so work through them in the sequence shown below, under Topics. When you finish, you should understand basic Metal concepts well enough to explore the rest of the documentation.


Basic Tasks

Performing Calculations on a GPU

Use Metal to find GPUs and perform calculations on them.

Using Metal to Draw a View’s Contents

Create a MetalKit view and a render pass to draw the view’s contents.

Viewing Your GPU Workload with the Metal Debugger

Step through your app's state on the GPU using various Metal tools in Xcode.

Synchronizing CPU and GPU Work

Avoid stalls between CPU and GPU work by using multiple instances of a resource.

Creating and Sampling Textures

Load image data into a texture and apply it to a quadrangle.

See Also


Migrating OpenGL Code to Metal

Replace your app’s deprecated OpenGL code with Metal.