An encoder that encodes your app's compute commands.
- iOS 8.0+
- macOS 10.11+
- tvOS 9.0+
To create a
MTLCompute object, call the
make method of the
MTLCommand object in which you want to encode compute commands. Do not use standard allocation and initialization techniques to create a
After you have created a
MTLCompute object, use it to encode the following data-parallel compute processing commands:
Specify resources that hold the input data (or output destination) for the compute function. Set the location (index) of each resource in its corresponding argument table.
dispatchmethod to encode the compute function with a specified number of threadgroups for the grid and the number of threads per threadgroup.
Threadgroups(_: threads Per Threadgroup:)
endto finish encoding the compute commands onto the command buffer.