openglonmetal / MGL

OpenGL 4.6 on Metal
Apache License 2.0
781 stars 30 forks source link

Why wouldn't you use mesa? #61

Closed airlied closed 1 year ago

airlied commented 1 year ago

Mesa already implements a fully abstracted compliant OpenGL 4.6 frontend, it has expended a lot of dev years. Instead of writing all that again you just write a gallium driver and NIR to metal shader layer.

darkaegisagain commented 1 year ago

Go for it, I will stick with a thin layer without the years of code bloat

Mike

Sent from my iPhone

On Oct 29, 2022, at 1:01 PM, Dave Airlie @.***> wrote:

 Mesa already implements a fully abstracted compliant OpenGL 4.6 frontend, it has expended a lot of dev years. Instead of writing all that again you just write a gallium driver and NIR to metal shader layer.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

airlied commented 1 year ago

What code bloat? Have you looked at the amount of code a GL 4.6 implementation requires? The error handling alone is years of work.

dokipen3d commented 1 year ago

hi dave, I'll just add in my 2 cents as a semi-profesional hobbyist.

I've been following mesa for a few years now (i follow you on twitter and a big fan of your work. I've tried a few times to get some kind of opengl 4.1+ programming on macos. I'll be honest and say that mesa on macos isn't the easiest thing to set up. I've tried learning the codebase in the hope to add stuff to make it work but I do think that there are a lot components and I just haven't managed to make it click yet. there doesn't seem to be a dri/windowing system for mac other than x11 and even then I ran I to link/library errors.

I'd love it if mesa was able to be a drop in on mac that could be used with glfw and zink/moltenvk. I'd even love to drive that if someone were willing to help me get started in the right direction.

MGL right now is scope limited and so doesn't support all of opengl, but it does compile and work without too much trouble which is was makes it attractive for people wanting to start tinkering with opengl on mac.

I don't think anyone is discounting the huge amount of work that has gone into mesa, I just think it comes along with a lot of other stuff that can make it seem intimidating and hard to integrate into an app and build system.

One example, I was able to add cmake to this project without too much trouble, but I've gone down rabbit holes trying to figure out how to even build mesa amd all of the different meson build options there are. it's a lot to take in.

I think this project was started by someone that wrote the apple opengl wrapper so there is some experience there that could be valuable to the community, especially mesa.

one day opengl will be free!

airlied commented 1 year ago

Mesa on OSX isn't something that is integrated with OSX at all well, I have no doubt the work to fix that is a lot less than the work to write a full GL stack, maybe less fun work but probably a lot more productive in the long term.

dokipen3d commented 1 year ago

maybe over Xmas, I'll dive into it again :)