Contents

makeLibrary(data:)

Creates a Metal library instance that contains the functions in a precompiled Metal library.

Declaration

func makeLibrary(data: DispatchData) throws -> any MTLLibrary

Parameters

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.

See Also

Creating shader libraries