<!--
{
  "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/MTLCounterSampleBufferError-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:SC27MTLCounterSampleBufferErrorLeV"
  },
  "title" : "MTLCounterSampleBufferError"
}
-->

# MTLCounterSampleBufferError

The error codes that indicate why a GPU driver can’t create a counter sample buffer.

```
struct MTLCounterSampleBufferError
```

## Topics

### Error code values

[`outOfMemory`](/documentation/Metal/MTLCounterSampleBufferError-swift.struct/outOfMemory)

An error code that indicates the GPU device doesn’t have sufficient memory to create a counter sample buffer.

[`invalid`](/documentation/Metal/MTLCounterSampleBufferError-swift.struct/invalid)

An error code that indicates the descriptor for creating a counter sample buffer descriptor has an invalid property.

[`internal`](/documentation/Metal/MTLCounterSampleBufferError-swift.struct/internal)

An error code that indicates the Metal framework has an internal problem.

[`MTLCounterSampleBufferError.Code`](/documentation/Metal/MTLCounterSampleBufferError-swift.struct/Code)

The underlying error code type that indicates why a GPU driver can’t create a counter sample buffer.

### Error domain

[`errorDomain`](/documentation/Metal/MTLCounterSampleBufferError-swift.struct/errorDomain)

The current counter sample buffer error domain.

[`MTLCounterErrorDomain`](/documentation/Metal/MTLCounterErrorDomain)

The domain for Metal counter sample buffer errors.



---

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)