maxTotalThreadsPerObjectThreadgroup
Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
Declaration
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:).
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.