Instance Property


The device object that the system recommends using for this view.


var preferredDevice: MTLDevice? { get }


On systems with a single GPU, this method returns the default Metal system device; see MTLCreateSystemDefaultDevice(). On systems with more than one GPU, this method returns the MTLDevice that was last used to composite and present the view’s contents. This device object usually corresponds to the GPU associated with the screen that’s displaying the view. If you set the view’s device property to this device object, you reduce the number of cross-GPU texture copies that Core Animation must make to present the view’s contents onscreen.

See Also

Configuring the Metal Device

var device: MTLDevice?

The device object the view uses to create its Metal objects.