init(forOfflineGPUAtIndex:)
Creates an OpenGL-based Core Image context using a GPU that is not currently driving a display.
Declaration
init?(forOfflineGPUAtIndex index: UInt32)Parameters
- index:
The index of the offline GPU with which to create the context; a number between zero and the value returned by the Offlinegpucount() method.
Return Value
A Core Image context.
Discussion
GPU devices that are not currently being used to drive a display can be used for Core Image rendering. Use the offlineGPUCount() method to determine whether any such GPUs are available.
To create a Metal-based Core Image context using an offline GPU, use the MTLCopyAllDevices() function to list Metal devices, then choose a device without a display to pass to the init(mtlDevice:) method.