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

# MTLStructMember

An instance that provides information about a field in a structure.

```
class MTLStructMember
```

## Overview

[`MTLStructMember`](/documentation/Metal/MTLStructMember) is part of the reflection API that allows Metal framework code to query details about an argument of a Metal shading language function. An [`MTLStructMember`](/documentation/Metal/MTLStructMember) instance describes the data type of one field in a struct that is passed as an [`MTLFunction`](/documentation/Metal/MTLFunction) argument, which is represented by [`MTLArgument`](/documentation/Metal/MTLArgument).

Don’t create [`MTLStructMember`](/documentation/Metal/MTLStructMember) instances directly. You obtain an [`MTLStructMember`](/documentation/Metal/MTLStructMember) instance from either the [`members`](/documentation/Metal/MTLStructType/members) property or the [`memberByName(_:)`](/documentation/Metal/MTLStructType/memberByName(_:)) method of an [`MTLStructType`](/documentation/Metal/MTLStructType) instance. The [`dataType`](/documentation/Metal/MTLStructMember/dataType) property of the [`MTLStructMember`](/documentation/Metal/MTLStructMember) instance tells you what kind of data is stored in the member. Recursively drill down every struct member until you reach a data type that is neither a struct nor an array.

## Topics

### Describing the struct member

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

The name of the struct member.

[`dataType`](/documentation/Metal/MTLStructMember/dataType)

The data type of the struct member.

[`offset`](/documentation/Metal/MTLStructMember/offset)

The location of this member relative to the start of its struct, in bytes.

[`argumentIndex`](/documentation/Metal/MTLStructMember/argumentIndex)

The index in the argument table that corresponds to the struct member.

### Obtaining struct member details

[`arrayType()`](/documentation/Metal/MTLStructMember/arrayType())

Provides a description of the underlying array when the struct member holds an array.

[`structType()`](/documentation/Metal/MTLStructMember/structType())

Provides a description of the underlying struct when the struct member holds a struct.

[`pointerType()`](/documentation/Metal/MTLStructMember/pointerType())

Provides a description of the underlying pointer when the struct member holds a pointer.

[`textureReferenceType()`](/documentation/Metal/MTLStructMember/textureReferenceType())

Provides a description of the underlying texture when the struct member holds a texture.



---

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)