---
title: sampleBuffer
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpasssamplebufferattachmentdescriptor/samplebuffer
---

# sampleBuffer

A specialized memory buffer that the GPU uses to store its counter data during the render pass.

## Declaration

```swift
var sampleBuffer: (any MTLCounterSampleBuffer)? { get set }
```

## Mentioned in

Sampling GPU data into counter sample buffers

## Discussion

Discussion The property defaults to nil, which means the GPU doesn’t save any GPU counter information during the render pass. For more information, see Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers.

## See Also

### Configuring the sample buffer attachment

- [startOfVertexSampleIndex](metal/mtlrenderpasssamplebufferattachmentdescriptor/startofvertexsampleindex.md)
- [endOfVertexSampleIndex](metal/mtlrenderpasssamplebufferattachmentdescriptor/endofvertexsampleindex.md)
- [startOfFragmentSampleIndex](metal/mtlrenderpasssamplebufferattachmentdescriptor/startoffragmentsampleindex.md)
- [endOfFragmentSampleIndex](metal/mtlrenderpasssamplebufferattachmentdescriptor/endoffragmentsampleindex.md)
