---
title: MTLCounterSampleBufferError
framework: metal
role: symbol
role_heading: Structure
path: metal/mtlcountersamplebuffererror-swift.struct
---

# MTLCounterSampleBufferError

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

## Declaration

```swift
struct MTLCounterSampleBufferError
```

## Topics

### Error code values

- [outOfMemory](metal/mtlcountersamplebuffererror-swift.struct/outofmemory.md)
- [invalid](metal/mtlcountersamplebuffererror-swift.struct/invalid.md)
- [internal](metal/mtlcountersamplebuffererror-swift.struct/internal.md)
- [MTLCounterSampleBufferError.Code](metal/mtlcountersamplebuffererror-swift.struct/code.md)

### Error domain

- [errorDomain](metal/mtlcountersamplebuffererror-swift.struct/errordomain.md)
- [MTLCounterErrorDomain](metal/mtlcountererrordomain.md)

## Relationships

### Conforms To

- [CustomNSError](foundation/customnserror.md)
- [Equatable](swift/equatable.md)
- [Error](swift/error.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
