---
title: "subscript(_:)"
framework: metal
role: symbol
role_heading: Instance Subscript
path: "metal/mtlcomputepasssamplebufferattachmentdescriptorarray/subscript(_:)"
---

# subscript(_:)

Returns the descriptor object for the specified sample buffer attachment.

## Declaration

```swift
subscript(attachmentIndex: Int) -> MTLComputePassSampleBufferAttachmentDescriptor! { get set }
```

## Parameters

- `attachmentIndex`: An index for the sample buffer attachment to fetch.

## Return Value

Return Value The requested  MTLComputePassSampleBufferAttachmentDescriptor object.
