Enable OpenGL software rendering on macOS
martin.pernollet at protonmail.com
Fri Apr 29 11:32:31 UTC 2022
TLDR : I failed using Mesa software rendering on macOS. I am looking for advice to invoke mesa's libGL.dylib without relying on macOS's system GL.
I am building (java) software involving Mesa for CPU rendering. I use CPU rendering as fallback when JOGL (OpenGL binding for Java) fail to use the GPU natively. This is sometime the case for old Linux distributions, this will certainly be frequent on macOS in the future due to Apple's OpenGL deprecation.
Mesa CPU rendering is working great on Ubuntu (by enabling LIBGL_ALWAYS_SOFTWARE=true) and Windows (by simply loading Mesa's DLL instead of system DLL, no need to ask for software mode).
I however thrive to useMesa's software rendering on macOSfor the following reasons
- Spying dynamic library load sequence shows that whenever Mesa's libGL.dylib is loaded, Apple Metal and libGL.dylib are loaded before, even when using DYLD tricks to ensure Mesa get loaded before any other library (except the Java VM)  Someone says that Mesa's macOS implementation relies on system GL . I noticed that when enabling LIBGL_ALWAYS_SOFTWARE=true, this activates Apple software rendering but not Mesa's software rendering .I wonder how I could avoid this and use a pure Mesa's OpenGL implementation in this situation.
- When getting out of the java World
- Running a pre-built glxgear/glxinfo installed through MacPorts only allows using Apple's libGL.dylib but not Mesa's libGL.dylib .
- Building glxinfo myself by linking explicitely to Mesa's GL + X11 lead to an X11 error that I am not able to depict .
This has been discussed already on Khronos community  but I have no clue how to go further. I hope some experts here can help me solve this!
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mesa-dev