Instance Method

setSamplePositions:count:

Sets the programmable sample positions for a render pass.

Declaration

- (void)setSamplePositions:(const MTLSamplePosition *)positions count:(NSUInteger)count;

Parameters

positions

An array of programmable sample positions for the render pass.

count

The number of programmable sample positions for the render pass.

Discussion

Programmable sample positions must be floating-point values in the [0.0, 1.0) range along each axis, with the origin (0,0) defined at the top-left corner. Values can be set from 0/16 up to 15/16, inclusive, in 1/16 increments along each axis.

If the value of count is 0, the default sample positions are used for the render pass.

See Also

Using Programmable Sample Positions

Positioning Samples Programmatically

Configure the position of samples when rendering to a multisampled render target.

Handling MSAA Depth with Programmable Sample Positions

Use depth render targets and programmable sample positions effectively.

MTLSamplePosition

A sample position on a subpixel grid.

MTLSamplePositionMake

Returns a new sample position on a subpixel grid.

- getSamplePositions:count:

Retrieves the programmable sample positions set for a render pass.