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

# MTLCounterSampleBufferDescriptor

A group of properties that configures the counter sample buffers you create with it.

```
class MTLCounterSampleBufferDescriptor
```

## Overview

To create a new counter sample buffer, create and configure an [`MTLCounterSampleBufferDescriptor`](/documentation/Metal/MTLCounterSampleBufferDescriptor) instance, and then call an [`MTLDevice`](/documentation/Metal/MTLDevice) instance’s [`makeCounterSampleBuffer(descriptor:)`](/documentation/Metal/MTLDevice/makeCounterSampleBuffer(descriptor:)) method. See [Creating a counter sample buffer to store a GPU’s counter data during a pass](/documentation/Metal/creating-a-counter-sample-buffer-to-store-a-gpus-counter-data-during-a-pass).

Each new sample counter buffer inherits the values of the descriptor’s properties when you create it. You can modify a descriptor and reuse it to create other counter sample buffers, which has no effect on existing counter sample buffers.

## Topics

### Configuring a descriptor for a counter sample buffer

[`counterSet`](/documentation/Metal/MTLCounterSampleBufferDescriptor/counterSet)

A GPU device’s counter set instance that you want to sample.

[`label`](/documentation/Metal/MTLCounterSampleBufferDescriptor/label)

The name for the counter sample buffer you create with the descriptor.

[`sampleCount`](/documentation/Metal/MTLCounterSampleBufferDescriptor/sampleCount)

The number of instances of a counter set’s data that a counter sample buffer can store.

[`storageMode`](/documentation/Metal/MTLCounterSampleBufferDescriptor/storageMode)

The memory storage mode for the counter sample buffers you create with the descriptor.



---

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)