RESOLVED FIXED 142498
[GTK] Add a configure option to build with OpenGL ES 2
https://bugs.webkit.org/show_bug.cgi?id=142498
Summary [GTK] Add a configure option to build with OpenGL ES 2
Carlos Garcia Campos
Reported 2015-03-09 11:08:06 PDT
It's not currently possible, I guess it's another regression of the CMake switch, or that we never supported it.
Attachments
Patch (6.44 KB, patch)
2015-03-09 11:14 PDT, Carlos Garcia Campos
no flags
Updated patch (6.45 KB, patch)
2015-03-09 11:28 PDT, Carlos Garcia Campos
no flags
Updated patch (6.57 KB, patch)
2015-03-09 11:32 PDT, Carlos Garcia Campos
no flags
Updated patch (7.09 KB, patch)
2015-03-09 11:47 PDT, Carlos Garcia Campos
mrobinson: review+
Martin Robinson
Comment 1 2015-03-09 11:13:53 PDT
OpenGLES2 should probably force EGL as well. GLX + OpenGLES doesn't really make sense, as far as I know.
Carlos Garcia Campos
Comment 2 2015-03-09 11:14:02 PDT
WebKit Commit Bot
Comment 3 2015-03-09 11:16:58 PDT
Attachment 248261 [details] did not pass style-queue: ERROR: Source/cmake/OptionsGTK.cmake:72: One space between command "endif" and its parentheses, should be "endif (" [whitespace/parentheses] [5] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 4 2015-03-09 11:18:12 PDT
Comment on attachment 248261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248261&action=review Looks okay to me, but we should probably not allow combining GLX + OpenGLES. > Source/cmake/OptionsGTK.cmake:69 > + find_package(GLES REQUIRED) Unrelated to this patch, but FindGLES is poorly named. There exists a historical OpenGLES which is different than OpenGLES2.
Carlos Garcia Campos
Comment 5 2015-03-09 11:19:44 PDT
(In reply to comment #4) > Comment on attachment 248261 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=248261&action=review > > Looks okay to me, but we should probably not allow combining GLX + OpenGLES. It's not possible, I think GLX is searched in find_package(OpenGL), that is only called when OpenGLES is didabled. > > Source/cmake/OptionsGTK.cmake:69 > > + find_package(GLES REQUIRED) > > Unrelated to this patch, but FindGLES is poorly named. There exists a > historical OpenGLES which is different than OpenGLES2. Did't even know it :-)
Martin Robinson
Comment 6 2015-03-09 11:22:42 PDT
(In reply to comment #5) > It's not possible, I think GLX is searched in find_package(OpenGL), that is > only called when OpenGLES is didabled. It looks like EGL is always detected and GLX is detected when building for X11. The checks shouldn't succeed if EGL isn't found, but OpenGLES2 is enabled.
Carlos Garcia Campos
Comment 7 2015-03-09 11:28:28 PDT
Created attachment 248262 [details] Updated patch Use the FindOpenGLES2.cmake one, which is indeed much better because it tries with pkg-config first
Carlos Garcia Campos
Comment 8 2015-03-09 11:29:38 PDT
(In reply to comment #6) > (In reply to comment #5) > > > It's not possible, I think GLX is searched in find_package(OpenGL), that is > > only called when OpenGLES is didabled. > > It looks like EGL is always detected and GLX is detected when building for > X11. The checks shouldn't succeed if EGL isn't found, but OpenGLES2 is > enabled. Oh, good point, we need EGL when using OpenGLES2
Carlos Garcia Campos
Comment 9 2015-03-09 11:32:45 PDT
Created attachment 248263 [details] Updated patch Fail if EGL not found when using GLES2
Martin Robinson
Comment 10 2015-03-09 11:35:19 PDT
View in context: https://bugs.webkit.org/attachment.cgi?id=248262&action=review > Source/cmake/OptionsGTK.cmake:94 > + # FIXME: Should we search for cairo-glesv2 instead of cairo-gl in this case? Yeah, this FIXME looks to have the correct suggestion. We probably need to pass an argument to FindCairoGL. > Source/cmake/OptionsGTK.cmake:329 > +if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND)) I think the OPENGES2 + GLX combination is still bogus. :) One easy way to fix it is to error out early if EGL isn't found.
Carlos Garcia Campos
Comment 11 2015-03-09 11:37:57 PDT
(In reply to comment #10) > View in context: > https://bugs.webkit.org/attachment.cgi?id=248262&action=review > > > Source/cmake/OptionsGTK.cmake:94 > > + # FIXME: Should we search for cairo-glesv2 instead of cairo-gl in this case? > > Yeah, this FIXME looks to have the correct suggestion. We probably need to > pass an argument to FindCairoGL. > > > Source/cmake/OptionsGTK.cmake:329 > > +if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND)) > > I think the OPENGES2 + GLX combination is still bogus. :) Yes, it is, but it simply can't happen if I understood correctly how cmake works. GLX_FOUND is set by find_package(OpenGL), that is only called when OPENGLES2 option is not present, so it's not possible to have both. > One easy way to > fix it is to error out early if EGL isn't found. That's what the patch does.
Carlos Garcia Campos
Comment 12 2015-03-09 11:42:54 PDT
(In reply to comment #11) > (In reply to comment #10) > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=248262&action=review > > > > > Source/cmake/OptionsGTK.cmake:94 > > > + # FIXME: Should we search for cairo-glesv2 instead of cairo-gl in this case? > > > > Yeah, this FIXME looks to have the correct suggestion. We probably need to > > pass an argument to FindCairoGL. > > > > > Source/cmake/OptionsGTK.cmake:329 > > > +if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND)) > > > > I think the OPENGES2 + GLX combination is still bogus. :) > > Yes, it is, but it simply can't happen if I understood correctly how cmake > works. GLX_FOUND is set by find_package(OpenGL), that is only called when > OPENGLES2 option is not present, so it's not possible to have both. > check_include_files is the thing searching for GLX? and setting GLX_FOUND? is that the case, I'm indeed wrong.
Martin Robinson
Comment 13 2015-03-09 11:46:20 PDT
(In reply to comment #12) > check_include_files is the thing searching for GLX? and setting GLX_FOUND? > is that the case, I'm indeed wrong. That was my understanding, but I may be mistaken.
Carlos Garcia Campos
Comment 14 2015-03-09 11:47:56 PDT
Created attachment 248265 [details] Updated patch I was wrong
Martin Robinson
Comment 15 2015-03-09 11:55:16 PDT
Comment on attachment 248265 [details] Updated patch The day that we don't have to worry about GLX and Desktop GL cannot come soon enough.
Carlos Garcia Campos
Comment 16 2015-03-10 06:20:11 PDT
Note You need to log in before you can comment on or make changes to this bug.