Instance Method

newDefaultLibrary

Creates a library object containing the functions in the app’s default Metal library.

Required.

Declaration

- (id<MTLLibrary>)newDefaultLibrary;

Return Value

A new library object that contains the functions from the default library. This method returns nil if the default library cannot be found.

Discussion

All .metal files in an Xcode project that builds an application are compiled and built into a single default library.

See Also

Creating Shader Libraries

- newDefaultLibraryWithBundle:error:

Creates a library object containing the functions stored in the default Metal library in the specified bundle.

Required.

- newLibraryWithFile:error:

Creates a library object containing the functions in a Metal library file at a specified path.

Required.

- newLibraryWithURL:error:

Creates a library object containing the functions in a Metal library file at a specified URL.

Required.

- newLibraryWithData:error:

Creates a library object containing the functions stored in a binary data object created from a precompiled Metal library.

Required.

- newLibraryWithSource:options:completionHandler:

Creates a library object asynchronously by compiling the functions stored in the specified source string.

Required.

- newLibraryWithSource:options:error:

Creates a library object synchronously by compiling the functions stored in the specified source string.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software