<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCounterDontSample",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@macro@MTLCounterDontSample"
  },
  "title" : "MTLCounterDontSample"
}
-->

# MTLCounterDontSample

A sentinel value that instructs an encoder to skip sampling a counter as the GPU runs the encoder’s pass.

```
var MTLCounterDontSample: Int { get }
```

## Discussion

You can skip sampling at specific stages by assigning this sentinel value to the following properties instead of an offset to a counter sample buffer:

|Types                                                                                                     |Properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|``doc://com.apple.metal/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor``               |``doc://com.apple.metal/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor/startOfVertexSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor/endOfVertexSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor/startOfFragmentSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor/endOfFragmentSampleIndex``|
|``doc://com.apple.metal/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptor``              |``doc://com.apple.metal/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptor/startOfEncoderSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptor/endOfEncoderSampleIndex``                                                                                                                                                                                                                                                                |
|``doc://com.apple.metal/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptor``                 |``doc://com.apple.metal/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptor/startOfEncoderSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptor/endOfEncoderSampleIndex``                                                                                                                                                                                                                                                                      |
|``doc://com.apple.metal/documentation/Metal/MTLResourceStatePassSampleBufferAttachmentDescriptor``        |``doc://com.apple.metal/documentation/Metal/MTLResourceStatePassSampleBufferAttachmentDescriptor/startOfEncoderSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLResourceStatePassSampleBufferAttachmentDescriptor/endOfEncoderSampleIndex``                                                                                                                                                                                                                                                    |
|``doc://com.apple.metal/documentation/Metal/MTLAccelerationStructurePassSampleBufferAttachmentDescriptor``|``doc://com.apple.metal/documentation/Metal/MTLAccelerationStructurePassSampleBufferAttachmentDescriptor/startOfEncoderSampleIndex`` ![](spacer) ``doc://com.apple.metal/documentation/Metal/MTLAccelerationStructurePassSampleBufferAttachmentDescriptor/endOfEncoderSampleIndex``                                                                                                                                                                                                                                    |

---

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)