subscript(dynamicMember name: String) -> ShaderFunction { get }
Returns a new shader function representing the stitchable MSL
function in the library called `name`.
Typically this subscript is used implicitly via the dynamic
member syntax, for example:
let fn = ShaderLibrary.default.myFunction
which creates a reference to the MSL function called
`myFunction()`.
init · iOS 17.0+
init
TypeScript
static initUrl(url: string): ShaderLibrary
Swift declaration
init(url: URL)
Creates a new Metal shader library from the contents of `url`,
which must be the location of precompiled Metal library.
Functions compiled from the returned library will only be
cached as long as the returned library exists.
init · iOS 17.0+
init
TypeScript
static initData(data: ArrayBuffer): ShaderLibrary
Swift declaration
init(data: Data)
Creates a new Metal shader library from `data`, which must be
the contents of precompiled Metal library. Functions compiled
from the returned library will only be cached as long as the
returned library exists.