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

# sampleCount

The number of samples in each fragment.

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

## Discussion

The default value is `1`. If [`textureType`](/documentation/Metal/MTLTextureDescriptor/textureType) is not [`MTLTextureType.type2DMultisample`](/documentation/Metal/MTLTextureType/type2DMultisample) or [`MTLTextureType.type2DMultisampleArray`](/documentation/Metal/MTLTextureType/type2DMultisampleArray), this value needs to be `1`.

Support for different sample count values varies by device. Call the [`supportsTextureSampleCount(_:)`](/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:)) method to determine if your desired sample count value is supported.

---

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)