Type Method

contextWithMTLDevice:options:

Creates a Core Image context using the specified Metal device and options.

Declaration

+ (CIContext *)contextWithMTLDevice:(id<MTLDevice>)device options:(NSDictionary<CIContextOption, id> *)options;

Parameters

device

The Metal device object to use for rendering.

options

A dictionary that contains options for creating a CIContext object. You can pass any of the keys defined in Context Options along with the appropriate value.

Return Value

A Core Image context.

Discussion

Use this method to choose a specific Metal device for rendering when a system contains multiple Metal devices. To create a Metal-based context using the system’s default Metal device, use the initWithOptions: method.

See Also

Creating a Context for GPU-Based Rendering with Metal

+ contextWithMTLDevice:

Creates a Core Image context using the specified Metal device.