---
title: MTLCounterSampleBuffer
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlcountersamplebuffer
---

# MTLCounterSampleBuffer

A specialized memory buffer that stores a GPU’s counter set data.

## Declaration

```swift
protocol MTLCounterSampleBuffer : NSObjectProtocol
```

## Mentioned in

Converting a GPU’s counter data into a readable format Confirming which counters and counter sets a GPU supports Converting GPU timestamps into CPU time Creating a counter sample buffer to store a GPU’s counter data during a pass Sampling GPU data into counter sample buffers

## Overview

Overview Create a counter sample buffer by calling an MTLDevice instance’s makeCounterSampleBuffer(descriptor:) method. See Creating a counter sample buffer to store a GPU’s counter data during a pass. You can store a GPU device’s counter set data only with an MTLCounterSampleBuffer instance that you create from the same device. See Sampling GPU data into counter sample buffers for information about storing counter sample data in a counter sample buffer.

## Topics

### Resolving the counter sample buffer’s data

- [resolveCounterRange(_:)](metal/mtlcountersamplebuffer/resolvecounterrange(_:).md)

### Inspecting the counter sample buffer’s configuration

- [label](metal/mtlcountersamplebuffer/label.md)
- [device](metal/mtlcountersamplebuffer/device.md)
- [sampleCount](metal/mtlcountersamplebuffer/samplecount.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Counter sample buffers

- [Creating a counter sample buffer to store a GPU’s counter data during a pass](metal/creating-a-counter-sample-buffer-to-store-a-gpus-counter-data-during-a-pass.md)
- [MTLCounterSampleBufferDescriptor](metal/mtlcountersamplebufferdescriptor.md)
- [Sampling GPU data into counter sample buffers](metal/sampling-gpu-data-into-counter-sample-buffers.md)
- [MTLCounterDontSample](metal/mtlcounterdontsample.md)
