---
title: "getDefaultSamplePositions:count:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/getdefaultsamplepositions:count:"
---

# getDefaultSamplePositions:count:

Retrieves the default sample positions for a specific sample count.

## Declaration

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

## Parameters

- `positions`: A pointer to a destination C array of doc://com.apple.metal/documentation/Metal/MTLSamplePosition instances — with at least count elements — the method writes the default positions to.
- `count`: The number of points a GPU can sample from a texture. Ensure the GPU can support the count value by first calling the device’s doc://com.apple.metal/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:) method.

## Mentioned in

Positioning samples programmatically

## Discussion

Discussion The default sample positions are the same on all GPUs that support programmable sample positions (see areProgrammableSamplePositionsSupported). note: GPUs that don’t support programmable sample positions may have different default sample positions that you can’t retrieve. The default sample position for GPUs that can sample one time is at the pixel’s center.

The default sample positions for GPUs that can sample two times have locations in the center of the pixel’s second quadrant and fourth quadrants.

The default sample positions for GPUs that can sample four times have one location in each of the pixel’s quadrants. Each location is at the center of one of that quadrant’s subquadrants.

The default sample positions for GPUs that can sample eight times have two locations in each of the pixel’s quadrants.

The table lists the indices and default locations for GPUs that support 1, 2, 4, or 8 sample positions.  |  |   |  |   |  |   |  |   |  |

## See Also

### Creating samplers

- [supportsTextureSampleCount(_:)](metal/mtldevice/supportstexturesamplecount(_:).md)
- [makeSamplerState(descriptor:)](metal/mtldevice/makesamplerstate(descriptor:).md)
