<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLLibraryError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLLibraryError"
  },
  "title" : "MTLLibraryError.Code"
}
-->

# MTLLibraryError.Code

Error codes for Metal library errors.

```
enum Code
```

## Topics

### Errors

[`MTLLibraryErrorUnsupported`](/documentation/Metal/MTLLibraryError-swift.struct/Code/unsupported)

Metal couldn’t support the requested action.

[`MTLLibraryErrorInternal`](/documentation/Metal/MTLLibraryError-swift.struct/Code/internal)

The action caused an internal error.

[`MTLLibraryErrorCompileFailure`](/documentation/Metal/MTLLibraryError-swift.struct/Code/compileFailure)

The library or function failed to compile.

[`MTLLibraryErrorCompileWarning`](/documentation/Metal/MTLLibraryError-swift.struct/Code/compileWarning)

The library or function compiled successfully but generated warnings.

[`MTLLibraryErrorFileNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/Code/fileNotFound)

Metal couldn’t find the Metal source file.

[`MTLLibraryErrorFunctionNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/Code/functionNotFound)

Metal couldn’t find the specified Metal function.

[`MTLLibraryErrorUnsupported`](/documentation/Metal/MTLLibraryError-swift.struct/Code/unsupported)

Metal couldn’t support the requested action.

[`MTLLibraryErrorInternal`](/documentation/Metal/MTLLibraryError-swift.struct/Code/internal)

The action caused an internal error.

[`MTLLibraryErrorCompileFailure`](/documentation/Metal/MTLLibraryError-swift.struct/Code/compileFailure)

The library or function failed to compile.

[`MTLLibraryErrorCompileWarning`](/documentation/Metal/MTLLibraryError-swift.struct/Code/compileWarning)

The library or function compiled successfully but generated warnings.

[`MTLLibraryErrorFileNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/Code/fileNotFound)

Metal couldn’t find the Metal source file.

[`MTLLibraryErrorFunctionNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/Code/functionNotFound)

Metal couldn’t find the specified Metal function.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)