-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
Add extra EGL extensions #1668
base: master
Are you sure you want to change the base?
Add extra EGL extensions #1668
Conversation
This patch adds multiple new EGL extensions which are useful for implementing Wayland applications. These have been mostly implemented manually, since gl_generator lacks support for these newer EGL extensions (except for `EGL_KHR_image_base`). The following extensions were added: - EGL_KHR_image_base - EGL_WL_bind_wayland_display - EGL_WL_create_wayland_buffer_from_image
Fwiw for #1658 I'd also like to use updated EGL bindings from Unfortunately it seems that efforts to transition ownership of |
I'm not sure how we should expose the ref to Maybe we should have a method to manually load(which will return I'm also interested in solving the generator issue upstream, but I'll see what we can do |
I added some functions to access the APIs for EGL and GLX. This works for my usecase at least, so maybe that's enough to just merge it? Let me know if you want a cleaner/more elaborate solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do with wgl...
egl::BindWaylandDisplayWL::load_with(loader); | ||
egl::UnbindWaylandDisplayWL::load_with(loader); | ||
egl::QueryWaylandBufferWL::load_with(loader); | ||
egl::CreateWaylandBufferFromImageWL::load_with(loader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe make it somehow done externally? So the user will have to load them if they want to, otherwise you'd have to add all the extensions here, which might be not great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this does load all the extensions which were added in this PR?
It seems odd to generate extensions, but then not load them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean, that you can add extension to egl_sys
but then don't update glutin
to load it, so only bump to egl_sys
will be required...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but then the functions will still be exposed, but when you try to call them it won't work? That just seems inconvenient to me from a user perspective.
IF you use the sys crate directly, it's more obvious that you need to load stuff.
This patch adds multiple new EGL extensions which are useful for
implementing Wayland applications. These have been mostly implemented
manually, since gl_generator lacks support for these newer EGL
extensions (except for
EGL_KHR_image_base
).The following extensions were added:
Currently this PR doesn't really implement a good way to access this new functionality, instead it just exposes the
EGL
static publicly. Ideally there would be some abstraction that retrieves theEgl
object, while automatically making sure it is initialized.So I see two options, feedback appreciated:
EGL.as_ref()?
(does not ensure initialization)Display
(requires display creation)