6. Metal Resources and Memory Management

Time is the scarcest resource and unless it is managed nothing else can be managed.—Peter Drucker

The purpose of Metal, in a nutshell, is to prepare data to be processed by the GPU. It doesn’t have to be vertex position data—it could be image data, fluid dynamic information, and so on. In Chapter 5, “Introduction to Shaders,” you explored how to program the GPU to process this data. In this chapter, you learn the ways to prepare blocks of data to be processed by the GPU.

Introduction to Resources in Metal

Resources in Metal are represented by instances of MTLResource. The MTLResource protocol defines the interface for any resource object that represents an allocation of memory. Resources fall into one ...

Get Metal Programming Guide: Tutorial and Reference via Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.