---
title: sampleCount
framework: metalkit
role: symbol
role_heading: Instance Property
path: metalkit/mtkview/samplecount
---

# sampleCount

The sample count used to generate the multisampleColorTexture object.

## Declaration

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

## Discussion

Discussion Support for different sample count values varies by device object. Call the supportsTextureSampleCount(_:) method to determine if the device object supports the sample count you want. The default value is 1. When you set a value greater than 1, the view creates and configures an intermediate set of multisample textures. The pixel format is the same as the one specified for the drawable; see colorPixelFormat. When the view creates a render pass descriptor, the render pass uses those intermediate textures as the color render targets, with a store action to resolve these multisample textures into the drawable’s texture (MTLStoreAction.multisampleResolve).

## See Also

### Configuring Multisampling

- [multisampleColorAttachmentTextureUsage](metalkit/mtkview/multisamplecolorattachmenttextureusage.md)
