<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLDevice/sparseTileSize(with:pixelFormat:sampleCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLDevice(im)sparseTileSizeWithTextureType:pixelFormat:sampleCount:"
  },
  "title" : "sparseTileSize(with:pixelFormat:sampleCount:)"
}
-->

# sparseTileSize(with:pixelFormat:sampleCount:)

Returns the dimensions of a sparse tile for a texture.

```
func sparseTileSize(with textureType: MTLTextureType, pixelFormat: MTLPixelFormat, sampleCount: Int) -> MTLSize
```

## Parameters

`textureType`

An [`MTLTextureType`](/documentation/Metal/MTLTextureType) instance.

`pixelFormat`

An [`MTLPixelFormat`](/documentation/Metal/MTLPixelFormat) instance.

`sampleCount`

The number of samples for each pixel.

## Return Value

A new [`MTLSize`](/documentation/Metal/MTLSize) instance.

## Discussion

The size of a sparse tile, in bytes, is the same for all sparse textures on a GPU device object. Because the size of pixels may vary, the actual dimensions of a sparse tile vary based on the texture and the pixel format. Use this method to get the dimensions of the tile for a particular format. Use these dimensions when converting regions from pixel-based units to sparse tile units and vice versa.

---

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)