Instance Method

setSamplePositions(_:)

Sets the programmable sample positions for a render pass.

Declaration

func setSamplePositions(_ positions: [MTLSamplePosition])

Parameters

positions

An array 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.

struct MTLSamplePosition

A sample position on a subpixel grid.

func MTLSamplePositionMake(Float, Float) -> MTLSamplePosition

Returns a new sample position on a subpixel grid.

func getSamplePositions() -> [MTLSamplePosition]

Returns the programmable sample positions set for a render pass.