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

# MTLStepFunction

The frequency and locations at which a function fetches attribute data.

```
enum MTLStepFunction
```

## Topics

### Step options

[`MTLStepFunction.constant`](/documentation/Metal/MTLStepFunction/constant)

The function fetches attribute data once.

[`MTLStepFunction.perInstance`](/documentation/Metal/MTLStepFunction/perInstance)

The function fetches data based on the instance index.

[`MTLStepFunction.perPatch`](/documentation/Metal/MTLStepFunction/perPatch)

The post-tessellation function fetches data based on the patch index of the patch.

[`MTLStepFunction.perPatchControlPoint`](/documentation/Metal/MTLStepFunction/perPatchControlPoint)

The post-tessellation function fetches data based on the control-point indices associated with the patch.

[`MTLStepFunction.perVertex`](/documentation/Metal/MTLStepFunction/perVertex)

The vertex function fetches data for every vertex.

[`MTLStepFunction.threadPositionInGridX`](/documentation/Metal/MTLStepFunction/threadPositionInGridX)

The compute function fetches data based on the thread’s `x` coordinate.

[`MTLStepFunction.threadPositionInGridY`](/documentation/Metal/MTLStepFunction/threadPositionInGridY)

The compute function fetches data based on the thread’s `y` coordinate.

[`MTLStepFunction.threadPositionInGridXIndexed`](/documentation/Metal/MTLStepFunction/threadPositionInGridXIndexed)

The compute function fetches data by using the thread’s `x` coordinate to look up a value in the index buffer.

[`MTLStepFunction.threadPositionInGridYIndexed`](/documentation/Metal/MTLStepFunction/threadPositionInGridYIndexed)

The compute function fetches data by using the thread’s `y` coordinate to look up a value in the index buffer.



---

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)