I want to play with OpenGL on macOS 11.6. Awhile ago I tried and got something to run but it seemed to be broken so I assume OpenGL doesn’t work on this version of macOS. I’ve read this is expected on newer versions of macOS.

I read that I may still be able to use OpenGL on macOS by running it on top of Zink from the Mesa project, on top of MoltenVK, on top of Apple’s Metal graphics API.

But I’m having trouble figuring out how to set up Zink, Mesa, MoltenVK, etc. Is there a set of simple instructions to do so? I’m not very familiar with any of these yet.

So far I’ve been able to set up something with MoltenVK and see a spinning cube demo run:

  1. git clone https://github.com/KhronosGroup/MoltenVK
  2. Open MoltenVK/MoltenVKPackaging.xcodeproj in Xcode.
  3. Use Xcode to build MoltenVK framework.
  4. Open MoltenVK/Demos/Cube/Cube.xcodeproj in Xcode.
  5. In Xcode, configure MoltenVK framework to be the one just built: MoltenVK/MoltenVK/MoltenVK.xcframework
  6. In Xcode, click play button to see spinning cube.

I’ve tried to build Zink but haven’t succeeded yet. I cloned https://gitlab.freedesktop.org/mesa/mesa and then an example of the meson commands I’ve tried (none of which work) is:

meson --prefix=/tmp/zink -Dgallium-drivers=zink -Dmoltenvk-dir=~/src/opengl-app/MoltenVK/Package/Release/MoltenVK -Dc_std=c11 build-zink

It fails with:

meson.build:657:2: ERROR: Dependency "vulkan" not found, tried pkgconfig and system

Related info:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.