Instance Method

getSamplePositions:count:

Retrieves the programmable sample positions set for a render pass.

Declaration

- (NSUInteger)getSamplePositions:(MTLSamplePosition *)positions count:(NSUInteger)count;

Parameters

positions

A pointer to a destination array of sample positions where the retrieved programmable sample positions will be written to.

count

The number of programmable sample positions to retrieve.

Return Value

The total number of programmable sample positions set for the render pass.

Discussion

The value of count must be equal to the number of programmable sample positions set by a previous call to the setSamplePositions:count: method (the count parameter). Also, the positions array must contain at least as many elements as the value of count.

If you don't know the correct value for count, you may query this method by passing a nil array for positions and a 0 value for count. This method will then return the number of programmable sample positions that are currently set.

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.

- setSamplePositions:count:

Sets the programmable sample positions for a render pass.