<!--
{
  "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/MTLLinkedFunctions/groups",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLLinkedFunctions(py)groups"
  },
  "title" : "groups"
}
-->

# groups

An optional list of groups specifying which functions your shader can call at each call site.

```
var groups: [String : [any MTLFunction]]? { get set }
```

## Discussion

The default value is `nil`.

The default behavior is conservative and assumes that your shader can call any linked function from every call site. If you know that the shader can only call a limited subset of functions at a call site, you can annotate those sites in the shader with a name of a group and then specify the list of functions for that call site using this property. Specifying call sites and callable functions more precisely can improve performance.

For more information on how to specify call site groups, see [Metal Shading Language Specification](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf).

The value of this property is a dictionary whose keys are call site names and values are arrays specifying the list of functions that the shader can call from each site.

---

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)