Structure

MTLSamplePosition

A sample position on a subpixel grid.

Declaration

struct MTLSamplePosition

Overview

Floating-point values are 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 0/16 increments along each axis.

Topics

Initializers

init()

Returns a new sample position on a subpixel grid.

init(x: Float, y: Float)

Returns a new sample position on a subpixel grid at specified coordinates.

Instance Properties

var x: Float

The x position of the sample on the subpixel grid.

var y: Float

The y position of the sample on the subpixel grid.

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.

func MTLSamplePositionMake(Float, Float) -> MTLSamplePosition

Returns a new sample position on a subpixel grid.

func setSamplePositions([MTLSamplePosition])

Sets the programmable sample positions for a render pass.

func getSamplePositions() -> [MTLSamplePosition]

Returns the programmable sample positions set for a render pass.