<!--
{
  "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/MTLFunctionOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLFunctionOptions"
  },
  "title" : "MTLFunctionOptions"
}
-->

# MTLFunctionOptions

Options that define how Metal compiles a GPU function.

```
struct MTLFunctionOptions
```

## Topics

### Function compilation options

[`MTLFunctionOptionNone`](/documentation/Metal/MTLFunctionOptions/MTLFunctionOptionNone)

A sentinel value that represents an empty set of options, which is the default behavior for creating functions.

[`failOnBinaryArchiveMiss`](/documentation/Metal/MTLFunctionOptions/failOnBinaryArchiveMiss)

An option that instructs the compiler to return an error when a GPU function isn’t in a binary archive.

[`compileToBinary`](/documentation/Metal/MTLFunctionOptions/compileToBinary)

An option that instructs the compiler to generate a binary format for dynamic linking.

[`pipelineIndependent`](/documentation/Metal/MTLFunctionOptions/pipelineIndependent)

An option that generates the same function handle across all pipeline states that link a function, which lets you share function tables across pipeline states.

[`storeFunctionInMetalPipelinesScript`](/documentation/Metal/MTLFunctionOptions/storeFunctionInMetalPipelinesScript)

An option that instructs the compiler to store function information for inspecting binary archives.

[`storeFunctionInMetalScript`](/documentation/Metal/MTLFunctionOptions/storeFunctionInMetalScript)

An option that instructs the compiler to store function information for inspecting binary archives.

### Swift support

[`init(rawValue:)`](/documentation/Metal/MTLFunctionOptions/init(rawValue:))

Creates a new function options structure from a raw value.



---

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)