The device object that the system recommends using for this layer.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
Framework
- Core Animation
Declaration
@property(readonly) id<MTLDevice> preferredDevice;
Discussion
On systems with a single GPU, this method returns the default device object; see MTLCreate
. On systems with more than one GPU, this method returns the MTLDevice
that was last used to composite and present the CAMetal
. This device object usually corresponds to the GPU associated with the screen that’s displaying the layer. If you set the layer’s device
property to this device object, you reduce the number of cross-GPU texture copies that Core Animation must perform to present the layer’s contents onscreen.