-
Notifications
You must be signed in to change notification settings - Fork 44
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
EGL contexts in GrDirectContext.MakeEGL #294
base: main
Are you sure you want to change the base?
EGL contexts in GrDirectContext.MakeEGL #294
Conversation
…L contexts with EGL There are two ways of enabling EGL support on Linux AFAIK: `skia_use_egl=true` switches over to X11 completely. Or we just add `GrGLInterfaces::MakeEGL` to GLX builds. This is the 2nd approach. `skia_use_egl=true` is simpler, but modifies existing X11 behavior. Fixes kyamagu#287
This pull is complete as is (with tests etc), but I am against merging, for reasons of doubting its being generally useful and long-term effort of maintaining the addition. |
The mac 13 Intel build unfortunately is expected to fail because of actions/runner-images#11241 . If that's the only failed job, re-run when that issue is addressed. |
I need to test this here, it is certainly an oversight: the egl api works in X with real hardware, and work headless with real hardware. I have never tried doing EGL with Xvfb - it looks like the EGL API segfaults in software-only X! This isn't a surprise on hindsight: the whole point of EGL is to use real GPU without X, so I have never tried it with software-only Xvfb. So the EGL API needs to detect when is Xvfb and just bail, rather than segfault. |
Cannot reproduce the problem locally, but the most likely source of segfault is that Xvfb is not capable of EGL in CI. This change allows EGL context to fail if under "some sort" of X.
…keGL Another go at fixing EGL segfault - maybe the libEGL's are too old: On EL7, EGL/egl.h is in mesa-libEGL-devel instead of libglvnd-devel (later Redhat) Missing GLES2/gl2.h - in mesa-libGLES-devel
Looking more carefully, the segfault in CI seems to be on load, rather than at the specific tests. And with the other changes (the EGL headers are in different packages compared to current redhat/fedora - my own system), really suggests that the segfault is a side-effect of #175 - building against an old libEGL and running on new system can segfault; hence my latest addition to this pull. This adds to my reservation against merging this - the EGL libraries seems to be not backward ABI compatible, hence not expected to be compatie across vendor either. I.e. @Swarzox you should take this pull and build it on your platform against the system's own EGL, whatever it is shipped with. Don't use binary wheels from somebody else. |
The current gn code still has this problem, so upgrading gn isn't useful. Hence a custom patch.
This reverts commit 2fa072e. Current gn has this fixed: commit 0725d7827575b239594fbc8fd5192873a1d62f44 Author: David 'Digit' Turner <[email protected]> Date: Tue Jan 18 12:14:01 2022 +0100 Remove misc GCC-related compiler warnings.
Current gn does not like being compiled with older g++:
While older gn doesn't like being compiled with newer g++ (though we had a patch for this earlier) |
This is a slightly different way of addressing #287 . I am posting this just as a reference for @Swarzox , and if he wants to try the CI builds to see if it works in his usage. Personally, I am against merging this in its current form, for 3 reasons:
Fixes #287
Cc @Swarzox this pull add two new ways of getting a GL context:
skia.GrDirectContext.MakeGL(skia.GrGLInterface.MakeEGL())
andskia.GrDirectContext.MakeGL(skia.GrGLInterface.MakeGLX())
, to explicitly initialize GL contexts in those two ways.skia.GrDirectContext.MakeGL()
is still via GLX. As I commented in #287 , if you setskia_use_egl=true
when building skia, the default switches to via EGL.I'd be interested in two things:
Depending on the answer to the 2nd question, we might still think about merging this, if there is a good reason...