Also, you can use OpenGL for GUI compositing, too, not only as a 3D context.
https://github.com/juce-framework/JUCE/blob/4e68af7fde8a0a64...
It uses CoreGraphics to render into a bitmap on the CPU, which is then uploaded into a Metal texture.