---
title: startOfEncoderSampleIndex
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlresourcestatepasssamplebufferattachmentdescriptor/startofencodersampleindex
---

# startOfEncoderSampleIndex

The index the Metal device object should use to store GPU counters when starting the resource state pass.

## Declaration

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

## Mentioned in

Sampling GPU data into counter sample buffers

## Discussion

Discussion Specify MTLCounterDontSample if you don’t want to sample GPU counters at the start of the resource state pass. 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 you need to set the value to MTLCounterDontSample.

## See Also

### Configuring the sample buffer attachment

- [sampleBuffer](metal/mtlresourcestatepasssamplebufferattachmentdescriptor/samplebuffer.md)
- [endOfEncoderSampleIndex](metal/mtlresourcestatepasssamplebufferattachmentdescriptor/endofencodersampleindex.md)
