---
title: MTLStepFunction.threadPositionInGridXIndexed
framework: metal
role: symbol
role_heading: Case
path: metal/mtlstepfunction/threadpositioningridxindexed
---

# MTLStepFunction.threadPositionInGridXIndexed

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

## Declaration

```swift
case threadPositionInGridXIndexed
```

## Discussion

Discussion This step function uses the x coordinate of the thread position in a grid as an index into the [[stage_in]] index buffer, which is then used to fetch data. In tessellation compute kernels, you use this step function to identify a control point in a given patch.

## See Also

### Step options

- [MTLStepFunction.constant](metal/mtlstepfunction/constant.md)
- [MTLStepFunction.perInstance](metal/mtlstepfunction/perinstance.md)
- [MTLStepFunction.perPatch](metal/mtlstepfunction/perpatch.md)
- [MTLStepFunction.perPatchControlPoint](metal/mtlstepfunction/perpatchcontrolpoint.md)
- [MTLStepFunction.perVertex](metal/mtlstepfunction/pervertex.md)
- [MTLStepFunction.threadPositionInGridX](metal/mtlstepfunction/threadpositioningridx.md)
- [MTLStepFunction.threadPositionInGridY](metal/mtlstepfunction/threadpositioningridy.md)
- [MTLStepFunction.threadPositionInGridYIndexed](metal/mtlstepfunction/threadpositioningridyindexed.md)
