-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
cmake: enable MLN_WITH_EGL and OPENGL_USE_GLES for Wayland #2022
Conversation
113f1cf
to
81fa322
Compare
You question about OPENGL_USE_GLES2 vs OPENGL_USE_GLES3 reminds me of #1079 where the change to GLES3 had to be reverted because the package that included it was GLES2. I wonder if it is similar here. |
It's not clear to me why there are GLESv2 and GLESv3 flags. The functions exist in the same file named libgles2.so. There is no libgles3.so. You can create an EGL config that works with both GLESv2 and GLESv3. The resolver handles the differences. Enabling config attributes should be exposed. Apache-2.0 Example: |
They apparently mostly help deciding whether The one thing that is not entirely clear to me is that it sets OPENGL_gles2_LIBRARY or OPENGL_gles3_LIBRARY, which are later searched. But Maplibre only requires the EGL component in the CMakeLists, not the GLES2 or GLES3 components. If it did, then it would be easy to know which At least setting either |
If it doesn't make much difference I would think it would be better to set "OPENGL_USE_GLES3", just because the code is ES 3.0 now #995 . pretty much everywhere else 'GLES2' got changed to 'GLES3' (there was just the one case I mentioned where that caused an issue, but most places it was fine.) |
81fa322
to
d0ce438
Compare
Is there something more I should be doing on this PR? If you don't think it makes sense, we can just close it 👍. |
For my curiosity, where is |
@ntadej: As described above, and as far as I can tell, it seems like it is mostly used in FindOpenGL.cmake. Without OPENGL_USE_GLES2 or OPENGL_USE_GLES3 set, the CMake module for OpenGL will include the GLVND library which is for X11. |
I don't think it will go further than this 🙈. |
I personally think it is fine, since it only changes anything if that - |
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2022-compared-to-main.txt |
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2022-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2022-compared-to-legacy.txt |
@JonasVautherin Can you add a comment to this PR? Then let's merge. Sounds like something that will be fixed upstream eventually. |
Not sure what you mean 😕. Do you want me to modify the description of the PR? 👀 |
@JonasVautherin Sorry, what I mean is, could you add a comment to the |
d0ce438
to
b9698d8
Compare
Oh, got it 😊. I added comments there, let me know what you think! |
Thanks, looks good. |
It seems codecov is not reporting for some reason ... |
According to https://app.codecov.io/gh/maplibre/maplibre-native/commits it is not uploaded... |
What it achieves
Without these changes, I need to configure with the unintuitive:
With these changes, I can configure successfully with:
The change
This change sets two values to TRUE in platform/linux/linux.cmake when
MLN_WITH_WAYLAND
is set:Further considerations
One could ask: "is it not an issue to set OPENGL_USE_GLES2, in case someone wants OPENGL_USE_GLES3?", and my (admittedly limited) understanding is that the FindOpenGL module will still detect the right one, but we need one to be set for the check here (otherwise it will look for the GLVND library). In my case, I have glfw-3 installed on my system, and it gets detected even with OPENGL_USE_GLES2 set. Not sure what would happen if I had both installed (my distro doesn't provide both, I can't test 🙈). Maybe it would be better to set OPENGL_USE_GLES3?
Notes
This is my suggestion to improve the Wayland build, following my struggling with #2019.
@jwinarske: FYI