Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is FallbackEgl the default instead of PreferEgl? #1719

Open
e00E opened this issue Nov 20, 2024 · 6 comments
Open

Why is FallbackEgl the default instead of PreferEgl? #1719

e00E opened this issue Nov 20, 2024 · 6 comments

Comments

@e00E
Copy link

e00E commented Nov 20, 2024

In glutin-winit the default ApiPreference is FallbackEgl. This choice should be justified with a comment. Why is not PreferEgl so that by default we pick EGL over GLX and WGL?

@kchibisov
Copy link
Member

If you want to learn more, you can click on DisplayApiPreference link and see for yourself.

If you have suggestions what should be there let me know, but generally, EGL is not broadly present on Windows, had long standing bugs on X11, and only worked ok on Wayland.

Also, if you want EGL for its specific features you just use glutin directly at this point.

@e00E
Copy link
Author

e00E commented Nov 20, 2024

I have read DisplayApiPreference. That documentation says the following:

But despite this issues it should be preferred on at least Linux over GLX, given that GLX is phasing away.

This means that on Linux, the default for FallbackEgl disagrees with this comment.

EGL is not broadly present on Windows

This is fine. If the default is PreferEgl, then glutin-winit will still use WGL if Egl is not available.

So I feel that on both Windows and Linux, the default PreferEgl makes more sense.

(I say this purely based on what I read in glutin. I haven't tested EGL, WGL, GLX.)

@e00E
Copy link
Author

e00E commented Nov 20, 2024

I'm not so much trying to change what the default is, but making sure that the choice is properly documented. At the moment this isn't the case.

@kchibisov
Copy link
Member

The issue is:

  1. Up until a months ago, transparency on EGL on X11 was not working at all. For years.
  2. EGL on windows is not great, most drivers don't ship it, and can get the default impl of EGL which may be not great as well.

Like if you know what you want, you can change default, but platform specific over cross platform default should make more sense, even though, platform specific is meh.

GLX is obsolete because of Xorg being it.

@e00E
Copy link
Author

e00E commented Nov 20, 2024

Thanks for explaining it more!

I still feel what you say here does not match the comment on DisplayApiPreference. That comment explicitly says that on Linux you should prefer egl over glx. Here you say the opposite. And the comment is missing some information you have added here.

It's up to you if and how you want to change that comment. Feel free to close the issue if you feel it's fine.

@kchibisov
Copy link
Member

If you don't care about transparency of your window on Linux, you should pick EGL, if you don't care, you should pick EGL.

EGL is better, but it GLX didn't had a bug with transparency, so it was used as a default, so you get things more or less working consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants