How do I use Mesa drivers on macOS?
Pekka Paalanen
ppaalanen at gmail.com
Tue Jan 2 11:10:32 UTC 2024
On Wed, 20 Dec 2023 15:24:18 -0500
John Klimek <jklimek at gmail.com> wrote:
> Thanks very much for the help! I was actually reading that thread as well.
>
> Is it true that Mesa on macOS requires X11 (Xquartz)? If so it's a
> dead-end for me unfortunately.
Hi,
I know nothing about macOS, but maybe I can clarify the fundamentals of
using OpenGL a bit. Mesa implements many more APIs than OpenGL flavors,
but it sounded like the question is specifically about some OpenGL
flavor.
OpenGL itself is a rendering API, which has nothing about platform
things like on-screen windows. You first need to use another API to
create an OpenGL context, which will provide a way for the rendering
results to interact with the window system, e.g. for the image to be
shown on an on-screen window. Let's call these "glue APIs" - there are
several options that an application can use, and the use must be
explicitly written in the application code, meaning that you cannot
switch from one glue API to another without replacing app code:
- GLX, traditionally shipped as part of libGL library; This requires
X11.
- EGL, which may support multiple different window systems (a.k.a EGL
platforms), and X11 is one of them. Still, the application must be
written specifically for the chosen window systems even when using
EGL. There is no "platform" extension listed in
https://registry.khronos.org/EGL/ that would sound like macOS.
- I think Windows has WGL which is requires... win32?
- No idea about macOS.
Therefore, to figure out if X11 is required, you would need to study
which glue API and how the game is written to use.
Mesa does not require X11 per se. It is possible to write an
application targeting some other EGL platform instead. Mesa EGL
implements even the surfaceless platform, which connects to no window
system at all, making it inherently off-screen and window system
agnostic.
EGL surfaceless platform combined with glvnd[1] (to allow both Mesa and
other vendor implementations of EGL and OpenGL APIs to co-exist) is the
modern alternative to OSMesa as far as I understand. AFAIK, glvnd was
primarily created to let NVIDIA drivers and Mesa co-exist on the same
Linux system. I don't know if it applies to macOS or any other OS, so I
don't dare to claim that OSMesa would be unnecessary today for new
applications.
[1] https://gitlab.freedesktop.org/glvnd/libglvnd
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-users/attachments/20240102/dcffbb4e/attachment.sig>
More information about the mesa-users
mailing list