Bug 145156 - REGRESSION(r181571): Build broken when USE(OPENGL_ES_2) is defined.
Summary: REGRESSION(r181571): Build broken when USE(OPENGL_ES_2) is defined.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 17:56 PDT by Carlos Alberto Lopez Perez
Modified: 2015-05-19 18:02 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.49 KB, patch)
2015-05-19 05:42 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2015-05-18 17:56:32 PDT
At least on platform GTK, r181571 <http://trac.webkit.org/r181571> broke the build when defining -DENABLE_GLES2=ON.

$CC [...] -o Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.o -c ../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1365:5: error: use of undeclared identifier 'glGenVertexArrays'
    glGenVertexArrays(1, &array);
    ^
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1379:5: error: use of undeclared identifier 'glDeleteVertexArrays'
    glDeleteVertexArrays(1, &array);
    ^
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1392:12: error: use of undeclared identifier 'glIsVertexArray'; did you mean 'isVertexArray'?
    return glIsVertexArray(array);
           ^~~~~~~~~~~~~~~
           isVertexArray
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1385:32: note: 'isVertexArray' declared here
GC3Dboolean GraphicsContext3D::isVertexArray(Platform3DObject array)
                               ^
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1403:5: error: use of undeclared identifier 'glBindVertexArray'; did you mean 'bindVertexArray'?
    glBindVertexArray(array);
    ^~~~~~~~~~~~~~~~~
    bindVertexArray
../../Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1399:25: note: 'bindVertexArray' declared here
void GraphicsContext3D::bindVertexArray(Platform3DObject array)
                        ^
4 errors generated.
ninja: build stopped: subcommand failed.


The issue seems to be that Vertex Array Objects (glGenVertexArrays, etc) are in GLESv3 but not in GLESv2.
Comment 1 Carlos Alberto Lopez Perez 2015-05-19 05:42:42 PDT
Created attachment 253382 [details]
Patch
Comment 2 WebKit Commit Bot 2015-05-19 05:44:27 PDT
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE
Comment 3 Carlos Alberto Lopez Perez 2015-05-19 08:33:02 PDT
Comment on attachment 253382 [details]
Patch

All EWS are happy, so asking for review now.
Comment 4 Alex Christensen 2015-05-19 12:25:26 PDT
Comment on attachment 253382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253382&action=review

> Source/ThirdParty/ANGLE/include/GLES2/gl2softlinking.h:-164
> -SOFT_LINK(libGLESv2, glBindVertexArray, void, GL_APIENTRY, (GLuint array), (array));
> -SOFT_LINK(libGLESv2, glDeleteVertexArrays, void, GL_APIENTRY, (GLsizei n, const GLuint* arrays), (n, arrays));
> -SOFT_LINK(libGLESv2, glGenVertexArrays, void, GL_APIENTRY, (GLsizei n, const GLuint* arrays), (n, arrays));
> -SOFT_LINK(libGLESv2, glIsVertexArray, GLboolean, GL_APIENTRY, (GLuint array), (array));

Great!  This is the proper response to my complaint in https://bugs.webkit.org/show_bug.cgi?id=126944

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1364
> +#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))

If we're not using OpenGLESv2, then we don't want WebGL2 functionality to be available at all.  This is a good compile fix, but I think we need to make it a step further and make this whole function not available instead of just returning 0.
Comment 5 Carlos Alberto Lopez Perez 2015-05-19 17:10:59 PDT
(In reply to comment #4)
> 
> > Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:1364
> > +#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
> 
> If we're not using OpenGLESv2, then we don't want WebGL2 functionality to be
> available at all.  This is a good compile fix, but I think we need to make
> it a step further and make this whole function not available instead of just
> returning 0.

My understanding is that WebGL2 should not be enabled/compiled when using OpenGLESv2, because OpenGLESv2 lacks some features that are needed for WebGL2 (like Vertex Array Objects).

Maybe bug 141178 is a good candidate to fix this in a proper way?.

In the meantime I would like to land at least this build fix.

BTW, Thanks for the review ;)
Comment 6 WebKit Commit Bot 2015-05-19 18:01:56 PDT
Comment on attachment 253382 [details]
Patch

Clearing flags on attachment: 253382

Committed r184605: <http://trac.webkit.org/changeset/184605>
Comment 7 WebKit Commit Bot 2015-05-19 18:02:02 PDT
All reviewed patches have been landed.  Closing bug.