Metal 系列二:GPU Devices--Get Shader Library

获取着色器

创建一个新库,其中包含存储在应用程序默认Metal库中的函数

func makeDefaultLibrary() -> MTLLibrary?
Creates a new library that contains the functions stored in the app’s default Metal library.

Required.

创建一个包含存储在指定包中的函数的新库。

func makeDefaultLibrary(bundle: Bundle) -> MTLLibrary
Creates a new library that contains the functions stored in the specified bundle.

Required.

创建一个新库,其中包含存储在指定Metal库中的函数

func makeLibrary(filepath: String) -> MTLLibrary
Creates a new library that contains the functions stored in the specified Metal library.

Required.

创建一个新库,其中包含指定URL处的Metal库文件中的函数

func makeLibrary(URL: URL) -> MTLLibrary
Creates a new library that contains the functions from a Metal library file at a specified URL.

Required.

创建一个新库,其中包含存储在指定二进制数据对象中的函数

func makeLibrary(data: __DispatchData) -> MTLLibrary
Creates a new library that contains the functions stored in the specified binary data object.

Required.

通过编译存储在指定源字符串中的函数来异步创建新库。

func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: MTLNewLibraryCompletionHandler)
Asynchronously creates a new library by compiling the functions stored in the specified source string.

Required.

同步创建一个新库,其中包含存储在指定源字符串中的函数。

func makeLibrary(source: String, options: MTLCompileOptions?) -> MTLLibrary
Synchronously creates a new library that contains the functions stored in the specified source string.

Required.


你可能感兴趣的:(Metal,Metal小专栏)