The glx/apple code is quite dated.  I think mesa has had a few architectural 
changes in the years since it was brought up (~15+ years ago).  If someone is 
really serious about hardware rendering for X11 apps running on macOS, I'd be 
happy to chat with them and point them in the right directions with more future 
focus:
    Wayland + Xwayland for X11 support
    Metal for rendering to IOSurfaces that back the windows
    DRI would be straight forward (share the IOSurface with the client)
    EGL and OpenGL on top of Vulcan+MoltenVK on Metal (removing macOS' 
OpenGL.fw and OpenGLES.fw from the equation completely)

#1 and #2 are where I think we get the biggest wins in terms of code debt, 
maintainability.

If you just want to get things building, you should point out to folks that 
they should not assume GLES is available and build their apps to support 
OpenGL.  If you want to invest minimal effort, you could probably get core 
support added to glx/apple without too much more work...


> On Sep 24, 2022, at 11:36, Ken Cunningham <ken.cunningham.web...@gmail.com> 
> wrote:
> 
> Reading through the mesa source, it seems that GLX uses hardware OpenGL 
> support on Darwin that was supplied by Apple initially in 2010, and updated 
> since (apple subdir in glx).
> 
> But if I am reading it correctly (and I easily might not be), the EGL 
> implementation on mesa does not use Apple hardware support, but instead 
> software rendering.
> 
> So — even though mesa with EGL will build on Darwin, performance would be 
> very much below GLX, so best avoided.
> 
> I have patched the gtk4 source to avoid requiring EGL for now, and forced GLX 
> to be used always. 
> 
> If I’m way off here, appreciate anyone putting me on the right path.
> 
> Best,
> 
> Ken
> 
> 
>> On Sep 12, 2022, at 9:50 PM, Ken Cunningham 
>> <ken.cunningham.web...@gmail.com> wrote:
>> 
>> Hello, first post.
>> 
>> I would like to ask about the status of EGL support in mesa for MacOS 
>> systems, whether it is mature and robust and usable at present for software 
>> builds. I know it can be toggled on in the mesa build on Darwin systems, and 
>> it generates. EGL headers and libraries. But is seems to be little used at 
>> present, as far as I can see.
>> 
>> Why:
>> 
>> I help maintain ports at MacPorts. Many of these use the gtk3 x11 version of 
>> the software, using an x11 server like xorg-server or XQuartz to display 
>> them. (A lesser number of software projects can use the gtk3 quartz 
>> interface instead.)
>> 
>> Lately, perhaps related to wayland, it seeems a number of software projects, 
>> eg gtk4, have been written assuming that x11 software will have EGL headers 
>> and libraries available, with GLX as a fallback.
>> 
>> If there are no EGL headers and support libraries available, these projects 
>> don’t readily compile without a fair bit of surgery to #ifdef out the 
>> assumed EGL support. It would be much easier to just use EGL instead, from 
>> mesa or otherwise, if it is robust.
>> 
>> Thanks,
>> 
>> Ken
> 

Reply via email to