Encodes a compute command using an arbitrarily sized grid.
- iOS 11.0+
- macOS 10.13+
The number of threads in the grid, in each dimension.
The number of threads in one threadgroup, in each dimension.
Use this method only if the device supports non-uniform threadgroup sizes. See Metal Feature Set Tables.
This method encodes a dispatch call that specifies an arbitrary number of threads in a grid (
threads). Metal calculates the number of threadgroups needed, providing partial threadgroups if necessary.
When the compute command is encoded, any necessary references to parameters or resources previously set on the encoder are recorded as part of the command. After encoding a command, you can safely change the encoding state to set up parameters needed to encode other commands.