<!--
{
  "availability" : [
    "iOS: 8.0.0 - 16.0.0",
    "iPadOS: 8.0.0 - 16.0.0",
    "macCatalyst: 13.1.0 - 16.0.0",
    "macOS: 10.11.0 - 13.0.0",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLArgument/index",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLArgument(py)index"
  },
  "title" : "index"
}
-->

# index

The index in the argument table that corresponds to the function argument.

```
var index: Int { get }
```

## Discussion

A command encoder ([`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) or [`MTLRenderCommandEncoder`](/documentation/Metal/MTLRenderCommandEncoder)) specifies the index in the corresponding argument table. For example, an app can call the [`setTexture(_:index:)`](/documentation/Metal/MTLComputeCommandEncoder/setTexture(_:index:)) method of [`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) to specify an index in the texture argument table for an [`MTLTexture`](/documentation/Metal/MTLTexture) instance that is used as an argument of a compute function.

---

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)