<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLFunction/functionConstantsDictionary",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLFunction(py)functionConstantsDictionary"
  },
  "title" : "functionConstantsDictionary"
}
-->

# functionConstantsDictionary

A dictionary of function constants for a specialized function.

```
var functionConstantsDictionary: [String : MTLFunctionConstant] { get }
```

## Discussion

This property returns a dictionary of the function constants that you need to provide to specialize this function. This property returns an empty dictionary if this function is already specialized or doesn’t declare any function constants.

To create the specialized function, set these constant values in a new [`MTLFunctionConstantValues`](/documentation/Metal/MTLFunctionConstantValues) object and call the [`makeFunction(name:constantValues:completionHandler:)`](/documentation/Metal/MTLLibrary/makeFunction(name:constantValues:completionHandler:)) method.

---

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)