<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.5.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTileRenderPipelineDescriptor/rasterSampleCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLTileRenderPipelineDescriptor(py)rasterSampleCount"
  },
  "title" : "rasterSampleCount"
}
-->

# rasterSampleCount

The number of samples in each fragment.

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

## 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`](/documentation/Metal/MTLRenderCommandEncoder), the [`sampleCount`](/documentation/Metal/MTLTexture/sampleCount) value of all attachments need to match this `sampleCount` value. Furthermore, the texture type of all attachments need to be [`MTLTextureType.type2DMultisample`](/documentation/Metal/MTLTextureType/type2DMultisample).

Support for different sample count values varies by device instance. Call the [`supportsTextureSampleCount(_:)`](/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:)) method on an [`MTLDevice`](/documentation/Metal/MTLDevice) instance to determine whether it supports a specific sample count.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)