Contents

sampleCount

The number of samples the pipeline applies for each fragment.

Declaration

var sampleCount: Int { get set }

Discussion

The render pipeline state honors this property only if the pipeline render targets support multisampling.

When your create an MTLRenderCommandEncoder instance, this property’s value needs to be equal to the number of render target textures. Furthermore, the texture type of all render target textures need to be MTLTextureType.type2DMultisample.

The number of samples a GPU supports varies by device. You can check whether an MTLDevice instance supports a specific sample count by calling its supportsTextureSampleCount(_:) method.

The default value for this property is 1.

See Also

Specifying rasterization and visibility state