Skip to content

Conversation

HinTak
Copy link

@HinTak HinTak commented Jun 4, 2024

Implement automatic software renderer re-try, and run glfwinfo post-build in the headless environment.

Fixes #2080 and #2570

elmindreda and others added 3 commits December 11, 2017 21:14
This window hint allows choosing between hardware and software renderers
(where available) for the created OpenGL or OpenGL ES context.

Fixes glfw#589.
I found that I needed to do a special DELETE_TERMINATING_NULL, because
SET_ATTRIB(x, 0) are present elsewhere, and DELETE_ATTRIB(0) is not
the reverse of ADD_ATTRIB(0).

The DELETE_ATTRIB macro is not robust enough - there should be an
UNSET_ATTRIB(a,v).

fixes glfw#2570
fixes glfw#2080
@jonathanhogg
Copy link

If it's still useful to know, I can confirm that this works for me on macOS Apple Silicon.

It is painfully slow as the software renderer appears to use only a single core. Sadly it also seems to have a mesh render bug with a few of my examples.

@WerWolv
Copy link

WerWolv commented Jan 1, 2025

Correctly uses accelerated graphics for me on my M2 Macbook Air 👍

@iTrooz
Copy link

iTrooz commented Jan 4, 2025

I can confirm the exact same build as Werwolv runs in a virtual machine with the "Apple Software Renderer" renderer (while a regular glfw release would not work)

@sleeptightAnsiC
Copy link

sleeptightAnsiC commented Jun 8, 2025

Thanks for PR @HinTak

I'm using it for running my tiny GLFW project inside of VM with macOS Ventura 13.6.9 x86_64 and it works quite well there. I've recently started messing with setting GLFW_CONTEXT_RENDERER explicitly (and also on Linux) and found some issues which made me look into the code more carefully. I've left few notes here and there. Hope you don't mind.

@HinTak
Copy link
Author

HinTak commented Jun 8, 2025

I explained at the beginning that this is mainly about Apple github CI #2570 . I can't remember why I have WGL or EGL code in there. As for headless Linux, I have already got an alternative: https://github.com/kyamagu/skia-python/blob/17a97a0e547c42acac6d9d6e0ec91960685d89a9/.github/workflows/ci.yml#L215 .

There is a EGL issue (and even a stale EGL branch) here, I believe. Linux / Mesa related comments should go there instead.

@HinTak
Copy link
Author

HinTak commented Jun 8, 2025

There is a (stale) EGL branch https://github.com/glfw/glfw/tree/egldevice .

@sleeptightAnsiC
Copy link

sleeptightAnsiC commented Jun 8, 2025

this is mainly about Apple github CI #2570 . I can't remember why I have WGL or EGL code in there.

This is quite confusing... Not gonna lie 👀

Sorry, I simply looked at the diffs and since they show that PR touches way more code and adds more hints I though it's not only about what mentioned in the description (and not only about Apple platform itself).

I believe I know what is the source our of confusion, see commit history:
Screenshot_20250608_050647
Screenshot_20250608_050727
I think you did merge glfw/context-renderer into this PR by mistake, right (?) It seems like this brings all the code that I was refering to in my comments.

Sorry once again for not noticing this in the first place. I'm not near my workstation at the moment (writing this from phone). I'll try to move my comments to proper PRs per your request, as soon as I can.

In the meantime could you take a look at the commits? It really seems like the old commit was merged into this by mistake.

@HinTak
Copy link
Author

HinTak commented Jun 8, 2025

Look, can you comment on the other issue instead? #1592 . I am going to block you if you keep making unrelated comments.

@ColleagueRiley
Copy link

ColleagueRiley commented Jun 8, 2025

@HinTak, Your PR includes changes for more than just Apple Software Rendering. Maybe this was unintentional and a result of merging upstream, or maybe it accidentally pushes changes you didn't intend to be pushed?

Either way, it is important to review the changes before they are pulled. I suggest, if you can, simplifying the changes down to only the ones relevant to the PR (e.g., Apple Software Rendering). I hope that explains that confusion.

@HinTak
Copy link
Author

HinTak commented Jun 8, 2025

@ColleagueRiley it was intentional. Explained in #1592 . It is offensive to click on "review" when not qualified to do so. Please stop now.

@ws909
Copy link

ws909 commented Jul 10, 2025

@sleeptightAnsiC
Thanks for the feedback and reviews. It's quite helpful and is appreciated by the core maintainers/developers (not me) and the rest of the community (me, I guess?). All help offloading tasks is welcome.

You're right that this PR touches much more code than that responsible for the issue it seems to be concerned with. That's a problem, and in its current state, it doesn't seem take the full set of use-cases for GLFW into consideration. In other words, it's not ready for integration into GLFW.

Your feedback and comments are appropriate here. Everyone commenting here is qualified to do so.

CC @ColleagueRiley

@HinTak
Copy link
Author

HinTak commented Jul 10, 2025

Not interested in flame wars. Please stop now.

@HinTak HinTak closed this Jul 10, 2025
@HinTak HinTak deleted the apple-software-renderer-retry branch July 10, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow MacOS OpenGL software renderer?
9 participants