<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4RenderCommandEncoder/dispatchThreadsPerTile(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTL4RenderCommandEncoder(im)dispatchThreadsPerTile:"
  },
  "title" : "dispatchThreadsPerTile(_:)"
}
-->

# dispatchThreadsPerTile(_:)

Encodes a command that invokes a tile shader function from the encoder’s current tile render pipeline state.

```
func dispatchThreadsPerTile(_ threadsPerTile: MTLSize)
```

## Parameters

`threadsPerTile`

A [`MTLSize`](/documentation/Metal/MTLSize) instance that represents the number of threads the render pass uses per tile.
Set the size’s [`width`](/documentation/Metal/MTLSize/width) and [`height`](/documentation/Metal/MTLSize/height) properties to values that are less
than or equal to [`tileWidth`](/documentation/Metal/MTL4RenderCommandEncoder/tileWidth) and [`tileHeight`](/documentation/Metal/MTL4RenderCommandEncoder/tileHeight), respectively. Some GPU families
only support square tile dispatches and require the same value for width and height.
Set [`depth`](/documentation/Metal/MTLSize/depth) to `1`.

---

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)