Instance Property

sampleCount

The number of samples in each fragment.

Declaration

var sampleCount: Int { get set }

Discussion

The default value is 1. This value is only used if the pipeline render targets support multisampling. If the render targets do not support multisampling, then this value must be 1.

When a MTLRenderCommandEncoder object is created, the sampleCount value of all the render target textures must match this sampleCount value. Furthermore, the texture type of all render target textures must be MTLTextureType.type2DMultisample.

Support for different sample count values varies by device. Call the supportsTextureSampleCount(_:) method to determine if your desired sample count value is supported.

See Also

Specifying Rasterization and Visibility State

var isAlphaToCoverageEnabled: Bool

Indicates whether the alpha channel fragment output for colorAttachments is read and used to compute a sample coverage mask.

var isAlphaToOneEnabled: Bool

Indicates whether the alpha channel values for colorAttachments are forced to 1.0, which is the largest representable value.

var isRasterizationEnabled: Bool

Determines whether primitives are rasterized.

var inputPrimitiveTopology: MTLPrimitiveTopologyClass

Indicates the type of primitive topology being rendered.

var rasterSampleCount: Int

The number of samples in each fragment.

enum MTLPrimitiveTopologyClass

The primitive topologies available for rendering.