Instance Method

newDefaultLibrary

Creates a new library that contains the functions stored 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

Acquiring Shader Functions

- newDefaultLibraryWithBundle:error:

Creates a new library that contains the functions stored in the specified bundle.

Required.

- newLibraryWithFile:error:

Creates a new library that contains the functions stored in the specified Metal library.

Required.

- newLibraryWithURL:error:

Creates a new library that contains the functions from a Metal library file at a specified URL.

Required.

- newLibraryWithData:error:

Creates a new library that contains the functions stored in the specified binary data object.

Required.

- newLibraryWithSource:options:completionHandler:

Asynchronously creates a new library by compiling the functions stored in the specified source string.

Required.

- newLibraryWithSource:options:error:

Synchronously creates a new library that contains the functions stored in the specified source string.

Required.