A GPU that you use to draw graphics or do parallel computation.
- iOS 8.0+
- macOS 10.11+
- tvOS 9.0+
MTLDevice protocol defines the interface to a GPU. You can query a GPU device for the unique capabilities it offers your Metal app, and use the GPU device to issue all of your Metal commands. Don't implement this protocol yourself; instead, request a GPU from the system at runtime using
MTLCreate on iOS or tvOS, and on macOS, get a list of available GPU devices using
MTLCopy. See Getting the Default GPU for a full discussion on choosing the right GPU(s).
GPU devices are your go-to object to do anything in Metal, so all of the Metal objects your app interacts with come from the
MTLDevice instances you acquire at runtime. Device-created objects are expensive but persistent; many of them are designed to be initialized once and reused through the lifetime of your app. However, GPU device-created objects are specific to the GPU that issued them, so if you switch mid run to using different GPU(s), then you create a new suite of command objects from the new GPU device(s), too.