makeLibrary(data:)
Creates a Metal library instance that contains the functions in a precompiled Metal library.
Declaration
func makeLibrary(data: DispatchData) throws -> any MTLLibraryParameters
- data:
The data from a precompiled Metal library. For more information, see Building A Shader Library By Precompiling Source Files.
Return Value
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns nil.
Discussion
Use this method if your application manages its own archiving system for libraries — for example, if your app uses a single file that contains several libraries.