<!--
{
  "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/MTL4MeshRenderPipelineDescriptor/maxTotalThreadsPerObjectThreadgroup",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTL4MeshRenderPipelineDescriptor(py)maxTotalThreadsPerObjectThreadgroup"
  },
  "title" : "maxTotalThreadsPerObjectThreadgroup"
}
-->

# maxTotalThreadsPerObjectThreadgroup

Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.

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

## Discussion

This number represents the maximum size of the product of the components of parameter `threadsPerObjectThreadgroup`
that Metal can use when drawing with this pipeline in mesh shader dispatch methods, such as
[`drawMeshThreadgroups(threadgroupsPerGrid:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)`](/documentation/Metal/MTL4RenderCommandEncoder/drawMeshThreadgroups(threadgroupsPerGrid:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)).

The compiler’s optimizer can use the value of this property to generate more efficient code, specifically when
the value doesn’t exceed the thread execution width of the underlying GPU.

The default value of this property is `0`, which indicates that the number you pass to attribute
`[[max_total_threads_per_threadgroup(N)]]` of the pipeline’s object function determines the maximum
total threads per threadgroup.

When you specify both the `[[max_total_threads_per_threadgroup(N)]]` attribute and this property, you are responsible
for making sure these values match.

Additionally, you are responsible for ensuring this value doesn’t exceed the “maximum threads per threadgroup”
device limit documented in the “Metal Feature Set Tables” PDF:
<https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf>.

---

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)