<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLArgument"
  },
  "title" : "MTLArgument"
}
-->

# MTLArgument

Information about an argument of a graphics or compute function.

```
class MTLArgument
```

## Overview

An [`MTLArgument`](/documentation/Metal/MTLArgument) instance describes a single argument to a Metal function. Your app uses the [`MTLArgument`](/documentation/Metal/MTLArgument) properties to read details about a function argument as it was defined in the Metal Shading Language. You can determine the argument’s data type, access restrictions, and its associated resource type. For buffer, texture, and threadgroup memory arguments, additional properties can be read to determine more details about the argument.

Your app does not create an [`MTLArgument`](/documentation/Metal/MTLArgument) instance directly. Creating an [`MTLRenderPipelineState`](/documentation/Metal/MTLRenderPipelineState) or [`MTLComputePipelineState`](/documentation/Metal/MTLComputePipelineState) instance can generate a reflection instance ([`MTLRenderPipelineReflection`](/documentation/Metal/MTLRenderPipelineReflection) or [`MTLComputePipelineReflection`](/documentation/Metal/MTLComputePipelineReflection)) that contains [`MTLArgument`](/documentation/Metal/MTLArgument) instances.

## Topics

### Describing the argument

[`name`](/documentation/Metal/MTLArgument/name)

The name of the argument.

[`isActive`](/documentation/Metal/MTLArgument/isActive)

A Boolean that indicates whether the compiled function uses the argument.

[`index`](/documentation/Metal/MTLArgument/index)

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

[`type`](/documentation/Metal/MTLArgument/type)

The argument’s resource type.

[`access`](/documentation/Metal/MTLArgument/access)

The argument’s read and/or write access.

### Describing a buffer argument

[`bufferAlignment`](/documentation/Metal/MTLArgument/bufferAlignment)

The required byte alignment in memory for the buffer data.

[`bufferDataSize`](/documentation/Metal/MTLArgument/bufferDataSize)

The size, in bytes, of the buffer data.

[`bufferDataType`](/documentation/Metal/MTLArgument/bufferDataType)

The data type of the buffer data.

[`bufferStructType`](/documentation/Metal/MTLArgument/bufferStructType)

A description of the structure data of a buffer argument.

[`bufferPointerType`](/documentation/Metal/MTLArgument/bufferPointerType)

A description of the pointer to a buffer argument.

### Describing a texture argument

[`textureDataType`](/documentation/Metal/MTLArgument/textureDataType)

The data type of a texture argument.

[`textureType`](/documentation/Metal/MTLArgument/textureType)

The texture type of a texture argument.

[`isDepthTexture`](/documentation/Metal/MTLArgument/isDepthTexture)

A Boolean value that indicates whether the texture is a depth texture.

### Describing an array argument

[`arrayLength`](/documentation/Metal/MTLArgument/arrayLength)

The number of elements, if the argument is an array.

### Describing a threadgroup memory argument

[`threadgroupMemoryAlignment`](/documentation/Metal/MTLArgument/threadgroupMemoryAlignment)

The required byte alignment in memory for the threadgroup data.

[`threadgroupMemoryDataSize`](/documentation/Metal/MTLArgument/threadgroupMemoryDataSize)

The size, in bytes, of the threadgroup data.



---

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)