---
title: "getSamplePositions:count:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrenderpassdescriptor/getsamplepositions:count:"
---

# getSamplePositions:count:

Retrieves the programmable sample positions set for a render pass.

## Declaration

```occ
- (NSUInteger) getSamplePositions:(MTLSamplePosition *) positions count:(NSUInteger) count;
```

## Parameters

- `positions`: A pointer to a destination array of sample positions where Metal writes the programmable sample positions.
- `count`: The number of programmable sample positions to retrieve.

## Return Value

Return Value The total number of programmable sample positions set for the render pass.

## Discussion

Discussion The value of count needs to be equal to the number of programmable sample positions set by a previous call to the setSamplePositions:count: method (the count parameter). Also, the positions array needs to contain at least as many elements as the value of count. If you don’t know the correct value for count, you may query this method by passing a nil array for positions and a 0 value for count. This method returns the number of programmable sample positions that are currently set.

## See Also

### Using programmable sample positions

- [MTLSamplePositionMake(_:_:)](metal/mtlsamplepositionmake(_:_:).md)
- [setSamplePositions:count:](metal/mtlrenderpassdescriptor/setsamplepositions:count:.md)
