<!--
{
  "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/MTLRenderPassSampleBufferAttachmentDescriptor/endOfFragmentSampleIndex",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLRenderPassSampleBufferAttachmentDescriptor(py)endOfFragmentSampleIndex"
  },
  "title" : "endOfFragmentSampleIndex"
}
-->

# endOfFragmentSampleIndex

The index the Metal device object should use to store GPU counters when ending the render pass’s fragment stage.

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

## Discussion

Specify [`MTLCounterDontSample`](/documentation/Metal/MTLCounterDontSample) if you don’t want to sample GPU counters at the end of the fragment stage. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.

On devices that don’t support [`MTLCounterSamplingPoint.atStageBoundary`](/documentation/Metal/MTLCounterSamplingPoint/atStageBoundary) you need to set the value to [`MTLCounterDontSample`](/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)