A programmable graphics or compute function executed by the GPU.
- iOS 8.0+
- macOS 10.11+
- tvOS 9.0+
MTLFunction object is considered a specialized function if it contain function constants, otherwise it is considered a non-specialized function. Specialized functions are compiled at runtime because they must evaluate constant values for each of its function constants; non-specialized functions are compiled when their respective library is built.
Do not use standard allocation and initialization techniques to create a
MTLFunction object. Instead, use the function creation methods provided by the
MTLLibrary protocol. To compile and create a specialized function, call one of these
To fetch a pre-compiled, non-specialized function, call the