---
title: rasterSampleCount
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpipelinedescriptor/rastersamplecount
---

# rasterSampleCount

The number of samples the pipeline applies for each fragment.

## Declaration

```swift
var rasterSampleCount: Int { get set }
```

## Discussion

Discussion The render pipeline state honors this property only if the pipeline render targets support multisampling. important: This property needs to be 1 if the render targets don’t 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

- [isAlphaToCoverageEnabled](metal/mtlrenderpipelinedescriptor/isalphatocoverageenabled.md)
- [isAlphaToOneEnabled](metal/mtlrenderpipelinedescriptor/isalphatooneenabled.md)
- [isRasterizationEnabled](metal/mtlrenderpipelinedescriptor/israsterizationenabled.md)
- [inputPrimitiveTopology](metal/mtlrenderpipelinedescriptor/inputprimitivetopology.md)
- [MTLPrimitiveTopologyClass](metal/mtlprimitivetopologyclass.md)
- [sampleCount](metal/mtlrenderpipelinedescriptor/samplecount.md)
