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

# startOfEncoderSampleIndex

An index within a counter sample buffer that tells the GPU where to store counter data from the start of a compute pass.

```
var startOfEncoderSampleIndex: Int { get set }
```

## Discussion

This property indicates where the GPU stores the counter data within an [`MTLCounterSampleBuffer`](/documentation/Metal/MTLCounterSampleBuffer) instance that it samples at the beginning of a compute pass.

You can tell the GPU to skip sampling at the start of the compute pass by assigning [`MTLCounterDontSample`](/documentation/Metal/MTLCounterDontSample) to this property.

> Important:
> For ``doc://com.apple.metal/documentation/Metal/MTLDevice`` instances that don’t support ``doc://com.apple.metal/documentation/Metal/MTLCounterSamplingPoint/atStageBoundary`` (see ``doc://com.apple.metal/documentation/Metal/MTLDevice/supportsCounterSampling(_:)``), set this property to ``doc://com.apple.metal/documentation/Metal/MTLCounterDontSample``.

---

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)