preferredDevice
The device object that the system recommends using for this view.
Declaration
var preferredDevice: (any MTLDevice)? { get }Discussion
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.