<div style="font-family: arial; font-size: 14px;"><span>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.</span><div><br></div><div><br></div><div>Hi everyone,</div><div><br></div><div>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.</div><div><br></div><div>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).</div><div><br></div><div>I however thrive to use<span> </span><b>Mesa's software rendering on macOS<span> </span></b>for the following reasons</div><div><div><ul style="margin:0px;padding:0px 0px 0px 2em;font-size:1em"><li><span><span></span>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) [1] <span>Someone says that Mesa's macOS implementation relies on system GL [4].<span style="background-color:rgb(255, 255, 255);display:inline !important"> I noticed that when enabling <span style="background-color:rgb(255, 255, 255);display:inline !important">LIBGL_ALWAYS_SOFTWARE=true, this activates Apple software rendering but not Mesa's software rendering [5].</span> </span></span></span>I wonder how I could avoid this and use a pure Mesa's OpenGL implementation in this situation. </li><li><span>When getting out of the java World</span></li><ul style="margin:0px;padding:0px 0px 0px 2em"><li><span>Running a pre-built glxgear/glxinfo installed through MacPorts only allows using Apple's libGL.dylib but not Mesa's libGL.dylib [2]. </span></li><li><span>Building glxinfo myself by linking explicitely to Mesa's GL + X11 lead to an X11 error that I am not able to depict [3].</span></li></ul></ul><div><span><br></span></div></div><div><span>This has been discussed already on Khronos community [1] but I have no clue how to go further. I hope some experts here can help me solve this!</span></div><div><span><br></span></div><div><span>Thanks in advance,</span></div><div><span><br></span></div><div><span>Martin</span></div><div><span><br></span></div><div><span>[1] <span><a href="https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408</a></span></span></div><div><span>[2] <span><a href="https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/14" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/14</a></span></span></div><div><span>[3] <span><a href="https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/19" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/19</a></span></span></div><div><span>[4] <span><a href="https://community.khronos.org/t/how-to-use-opengl-on-zink-mesa-moltenvk-and-macos/108160/18" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://community.khronos.org/t/how-to-use-opengl-on-zink-mesa-moltenvk-and-macos/108160/18</a></span></span></div><div>[5] <span><a href="https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/17" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/17</a></span></div></div><div><br></div><div><br></div><div><br></div><span></span><br></div><div class="protonmail_signature_block" style="font-family: arial; font-size: 14px;">
</div>