<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLDynamicLibrary",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLDynamicLibrary"
  },
  "title" : "MTLDynamicLibrary"
}
-->

# MTLDynamicLibrary

A dynamically linkable representation of compiled shader code for a specific Metal device object.

```
protocol MTLDynamicLibrary : NSObjectProtocol, Sendable
```

## Topics

### Identifying the library

[`device`](/documentation/Metal/MTLDynamicLibrary/device)

The Metal device object that created the dynamic library.

[`installName`](/documentation/Metal/MTLDynamicLibrary/installName)

A file path for this dynamic library.

[`label`](/documentation/Metal/MTLDynamicLibrary/label)

A string that identifies the library.

### Saving a dynamic library to a file

[`serialize(to:)`](/documentation/Metal/MTLDynamicLibrary/serialize(to:))

Writes the contents of the dynamic library to a file.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)