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

# rasterSampleCount

The number of samples in each fragment.

## Declaration

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

## Discussion

Discussion The default value is 1. This value is used only if the pipeline render targets support multisampling. If the render targets don’t support multisampling, then this value needs to be 1. When you create a  MTLRenderCommandEncoder, the sampleCount value of all attachments need to match this sampleCount value. Furthermore, the texture type of all attachments need to be MTLTextureType.type2DMultisample. Support for different sample count values varies by device instance. Call the supportsTextureSampleCount(_:) method on an MTLDevice instance to determine whether it supports a specific sample count.

## See Also

### Specifying rasterization and visibility state

- [threadgroupSizeMatchesTileSize](metal/mtltilerenderpipelinedescriptor/threadgroupsizematchestilesize.md)
