Contents

MTLCreateSystemDefaultDevice()

Returns the device instance Metal selects as the default.

Declaration

func MTLCreateSystemDefaultDevice() -> (any MTLDevice)?

Mentioned in

Return Value

A device object.

Discussion

In macOS, in order for the system to provide a default Metal device object, you need to link to the Core Graphics framework. You usually need to do this explicitly if you’re writing apps that don’t use graphics by default, such as command line tools.

See Also

Locating and inspecting a GPU device