Instance Method

getDefaultSamplePositions:count:

Retrieves the default sample positions for a specific sample count.

Required.

Declaration

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

Parameters

positions

A pointer to a destination array of sample positions that the retrieved default sample positions are written to. The positions array must contain at least as many elements as the value of count.

count

The set of default sample positions you want to retrieve. The value of count must be in the range that the device object supports.

Discussion

The default sample positions are the same on all GPUs that support programmable sample positions. If programmableSamplePositionsSupported for a device object is NO, that device object may have sample positions that differ from these defaults. In that case, you can't retrieve information about the specific positions that GPU uses.

Before calling this method, call the supportsTextureSampleCount: method to determine whether a device object supports a given sample count.

Default One-Sample Position

The following table and grid show the position index, values, and placement for the default one-sample position.

Position index

Position values

0

0.5, 0.5

Coordinate system diagram showing the subpixel grid on which the default one-sample position is set.

Default Two-Sample Positions

The following table and grid show the position indices, values, and placements for the default two-sample positions.

Position index

Position values

0

0.75, 0.75

1

0.25, 0.25

Coordinate system diagram showing the subpixel grid on which the default two-sample positions are set.

Default Four-Sample Positions

The following table and grid show the position indices, values, and placements for the default four-sample positions.

Position index

Position values

0

0.375, 0.125

1

0.875, 0.375

2

0.125, 0.625

3

0.625, 0.875

Coordinate system diagram showing the subpixel grid on which the default four-sample positions are set.

Default Eight-Sample Positions

The following table and grid show the position indices, values, and placements for the default eight-sample positions.

Position index

Position values

0

0.5625, 0.3125

1

0.4375, 0.6875

2

0.8125, 0.5625

3

0.3125, 0.1875

4

0.1875, 0.8125

5

0.0625, 0.4375

6

0.6875, 0.9375

7

0.9375, 0.0625

Coordinate system diagram showing the subpixel grid on which the default eight-sample positions are set.

See Also

Querying Programmable Sample Positions

programmableSamplePositionsSupported

A Boolean that indicates whether a device supports programmable sample positions.

Required.