-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix some bugs in loading OpenGL/GLX/EGL libraries #229
Conversation
Without additional check, even if libOpenGL was loaded, libGL.so will be loaded as well, and used both in gl_handle and glx_handle, so libglvnd libraries will not be used.
Hmm, it looks like this leads to not loading GLX library, as epoxy_conservative_glx_dlsym is using |
I guess this is for @nwnk to review. |
I've found a way to fix problem with loading libGL/libGLX on every |
Here is output of strace for https://github.com/ebassi/glarea-example on libglvnd-enabled wayland (libGL.so/libGLX.so still exists): After: |
One thing we might want to consider is using EDIT: Oh hey, we are doing that. Excellent. |
Patch 1 2 and 4 in this series are:
Patch 3 ("Do not load symbols in epoxy_current_context_is_glx [...]") isn't great. With that change, |
@nwnk I'm completely fine, if you would merge only 3 commits. Third one was my best try on fixing the load of libGL.so on every symbol lookup, if EGL is used, but I'm not sure how to fix it properly. P.S. Right now I'm using libepoxy with my fixes on system without libGL/libGLX, and everything is completely fine. |
@nwnk Oh, and how it could be possible, to have GLX context without loading libGLX first? And to load it, application will use From what I've seen, So, my point is, there is no "current context" without creating it via GLX/EGL, so it's completely fine to return false in this case. And if context is created via GLX/EGL, then api.glx_handle/api.egl_handle will be populated, so |
This isn't necessarily true. Imagine plugin library A gets loaded first, which links against libGL directly, creates a GLX context, and makes it current. Then plugin library B is loaded, which links against epoxy. |
@nwnk Could we get 1, 2 and 4 merged? With them, I'm able to run virglrenderer without linking to GLX. |
Patch 2 introduces a test failure in I've opened #238 with patches 1 and 4. |
Any thoughts on whether #240 is a libepoxy bug or apitrace? |
@batesj I would say, that it is probably a apitrace not supporting libOpenGL.so. I cannot find any mentions of it in it's code, so, maybe it's trying to override libGL.so, but with my patch, it should not be used, if libOpenGL.so is present in the system |
@ebassi I'm fine if commit 2 (libGLX.so version fix) is omitted, it's probably different in different distributions. On GLX-free system there is no such file at all... |
Can there be a new release to pick up this bug fix? |
@batesj I just released 1.5.6 which contains the first and last commits of this MR. |
If nobody beats me to it, I'll try to carve some time to rework the third commit to follow the approach outlined by @nwnk. |
Any thoughts on bringing these fixes back without breaking some distros? Compile option perhaps? |
Without additional check, even if libOpenGL was loaded, libGL.so will be loaded as well, and used both in gl_handle and glx_handle, so libglvnd libraries will not be used.
The problem is that on Wayland-only system, there will be no libGL, so epoxy_load_gl will fail even if libOpenGL was loaded.