Contents

MTLLibrary

A collection of Metal shader functions.

Declaration

protocol MTLLibrary : NSObjectProtocol, Sendable

Mentioned in

Overview

An MTLLibrary instance contains Metal shading language source code compiled during an app’s build process or at runtime from a text string.

Don’t implement this protocol yourself; instead, use the library creation methods provided by the MTLDevice protocol. To create an MTLLibrary from a precompiled Metal library binary, call one of these MTLDevice methods:

To create an MTLLibrary by compiling source code at runtime, call one of these MTLDevice methods:

Topics

Querying basic library attributes

Querying library contents

Creating shader function instances

Creating intersection function instances

Identifying the library

Instance Methods

See Also

Shader library management