<!--
{
  "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.

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

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

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

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

[`MTLFunctionOptionPipelineIndependent`](/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.

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

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

[`MTLFunctionOptionStoreFunctionInMetalScript`](/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.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)