An object representing a public shader function in the library.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
MTLFunction object is considered a specialized function if it contains 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 precompiled, nonspecialized function, call the