A UIScreen object has a property nativeScale that provides the native screen scale factor for the screen. When the nativeScale property has the same value as the screen’s actual scale, then the rendered pixel dimensions are the same as the screen’s native pixel dimensions. When the two values differ, then you can expect the contents to be sampled before they are displayed.
A MTKView object automatically creates its renderbuffer objects based on the view’s size and the value of its contentScaleFactor property. After the view has been added to a window, set the view’s contentScaleFactor to the value stored in the screen’s nativeScale property.
If you create your own UIView subclass that is backed by a CAMetalLayer, in addition to the above, whenever your view’s size changes, and prior to asking the layer for a new drawable, you need to calculate and set the layer’s drawableSize property. See our MetalBasic3D sample for an example.