[WebGL2] Support compilation of GLSL ES version 300 shaders
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2018 20:00:54 +0000 (20:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2018 20:00:54 +0000 (20:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187982
<rdar://problem/42564229>

Patch by Justin Fan <justin_fan@apple.com> on 2018-07-30
Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/canvas/webgl/webgl2-glsl3-compile.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
* platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support.
(WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):

LayoutTests:

New simple test added to ensure that GLSL ES version 300 shaders compile.
Updated other test results in glsl3 to match new functionality.

* fast/canvas/webgl/webgl2-glsl3-compile-expected.txt: Added.
* fast/canvas/webgl/webgl2-glsl3-compile.html: Added.
* platform/ios/TestExpectations: Skipping ios for now.
* webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination-expected.txt:
* webgl/2.0.0/conformance2/glsl3/forbidden-operators-expected.txt:
* webgl/2.0.0/conformance2/glsl3/invalid-default-precision-expected.txt:
* webgl/2.0.0/conformance2/glsl3/invalid-invariant-expected.txt:
* webgl/2.0.0/conformance2/glsl3/misplaced-version-directive-expected.txt:
* webgl/2.0.0/conformance2/glsl3/sampler-no-precision-expected.txt:
* webgl/2.0.0/conformance2/glsl3/sequence-operator-returns-non-constant-expected.txt:
* webgl/2.0.0/conformance2/glsl3/texture-offset-out-of-range-expected.txt:
* webgl/2.0.0/conformance2/glsl3/texture-offset-uniform-texture-coordinate-expected.txt:
* webgl/2.0.0/conformance2/glsl3/uniform-block-layout-match-expected.txt:
* webgl/2.0.0/conformance2/glsl3/uniform-block-layouts-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234380 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
LayoutTests/webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/forbidden-operators-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/invalid-default-precision-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/invalid-invariant-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/misplaced-version-directive-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/sampler-no-precision-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/sequence-operator-returns-non-constant-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/texture-offset-out-of-range-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/texture-offset-uniform-texture-coordinate-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/uniform-block-layout-match-expected.txt
LayoutTests/webgl/2.0.0/conformance2/glsl3/uniform-block-layouts-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h
Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp

index 5c9c4cb..39fd83f 100644 (file)
@@ -1,3 +1,29 @@
+2018-07-30  Justin Fan  <justin_fan@apple.com>
+
+        [WebGL2] Support compilation of GLSL ES version 300 shaders
+        https://bugs.webkit.org/show_bug.cgi?id=187982
+        <rdar://problem/42564229>
+
+        Reviewed by Dean Jackson.
+
+        New simple test added to ensure that GLSL ES version 300 shaders compile.
+        Updated other test results in glsl3 to match new functionality.
+
+        * fast/canvas/webgl/webgl2-glsl3-compile-expected.txt: Added.
+        * fast/canvas/webgl/webgl2-glsl3-compile.html: Added.
+        * platform/ios/TestExpectations: Skipping ios for now. 
+        * webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/forbidden-operators-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/invalid-default-precision-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/invalid-invariant-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/misplaced-version-directive-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/sampler-no-precision-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/sequence-operator-returns-non-constant-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/texture-offset-out-of-range-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/texture-offset-uniform-texture-coordinate-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/uniform-block-layout-match-expected.txt:
+        * webgl/2.0.0/conformance2/glsl3/uniform-block-layouts-expected.txt:
+
 2018-07-30  Ryan Haddad  <ryanhaddad@apple.com>
 
         Rebaseline fast/forms/file/input-file-re-render.html for Mojave.
diff --git a/LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile-expected.txt b/LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile-expected.txt
new file mode 100644 (file)
index 0000000..d636bac
--- /dev/null
@@ -0,0 +1,12 @@
+Make sure that compiling GLSL ES 3 shaders works as expected.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS success is true
+PASS success is true
+PASS success is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile.html b/LayoutTests/fast/canvas/webgl/webgl2-glsl3-compile.html
new file mode 100644 (file)
index 0000000..18a42d0
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="40" height="40"></canvas>
+
+<script>
+var success = false;
+function compileShader(gl, shaderSource, shaderType) {
+    var shader = gl.createShader(shaderType);
+
+    gl.shaderSource(shader, shaderSource);
+
+    gl.compileShader(shader);
+
+    success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
+
+    shouldBe("success", "true");
+
+    return shader;
+}
+
+function createProgram(gl, vertexShader, fragmentShader) {
+    var program = gl.createProgram();
+
+    gl.attachShader(program, vertexShader);
+    gl.attachShader(program, fragmentShader);
+
+    gl.linkProgram(program);
+
+    success = gl.getProgramParameter(program, gl.LINK_STATUS);
+
+    shouldBe("success", "true");
+
+    return program;
+}
+
+description("Make sure that compiling GLSL ES 3 shaders works as expected.");
+
+if (window.internals)
+    internals.settings.setWebGL2Enabled(true);
+
+var vertexShaderSource = `#version 300 es
+layout(location = 0) in vec2 pos;
+
+void main()
+{
+    gl_Position = vec4(pos, 0.0, 1.0);
+}
+`;
+
+var fragmentShaderSource = `#version 300 es
+precision mediump float;
+out vec4 color;
+
+void main()
+{
+    color = vec4(1.0, 0.5, 0.0, 1.0);
+}
+`;
+    
+var canvas = document.getElementById("canvas");
+var gl = canvas.getContext("webgl2");
+
+var vertexShader = compileShader(gl, vertexShaderSource, gl.VERTEX_SHADER);
+var fragmentShader = compileShader(gl, fragmentShaderSource, gl.FRAGMENT_SHADER);
+
+var program = createProgram(gl, vertexShader, fragmentShader);
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
+
index 7894958..6c1c46f 100644 (file)
@@ -3339,3 +3339,6 @@ fast/block/block-only/relative-auto-with-parent-offset.html [ Failure ]
 # Datalist
 webkit.org/b/186714 fast/forms/datalist/datalist-show-hide.html [ Skip ]
 webkit.org/b/186714 fast/forms/datalist/datalist-textinput-keydown.html [ Skip ]
+
+# We are only accepting GLSL3 for macOS. 
+webkit.org/b/187982 webgl/2.0.0/conformance2/glsl3 [ Skip ]
index a3d0f37..ffcb282 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/compound-assignment-type-combination.html
-FAIL
+PASS
 
index 032a34e..8f9539a 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/forbidden-operators.html
-FAIL
+PASS
 
index 0d3d8bf..ac2f3ba 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/invalid-default-precision.html
-FAIL
+PASS
 
index 1776b32..8386422 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/invalid-invariant.html
-FAIL
+PASS
 
index 35044b5..8a2f466 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/misplaced-version-directive.html
-FAIL
+PASS
 
index 78c89c0..60a7e89 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/sampler-no-precision.html
-FAIL
+PASS
 
index 34021cb..f43dc64 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/sequence-operator-returns-non-constant.html
-FAIL
+PASS
 
index 2a86a47..0620f70 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/texture-offset-out-of-range.html
-FAIL
+PASS
 
index 15ce031..ad4dc49 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html
-FAIL
+PASS
 
index ffd8852..a5fbe84 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/uniform-block-layout-match.html
-FAIL
+PASS
 
index cb2b8d6..a93e2a9 100644 (file)
@@ -1,5 +1,5 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance2/glsl3/uniform-block-layouts.html
-FAIL
+PASS
 
index 7e11e02..422ba3d 100644 (file)
@@ -1,5 +1,27 @@
 2018-07-30  Justin Fan  <justin_fan@apple.com>
 
+        [WebGL2] Support compilation of GLSL ES version 300 shaders
+        https://bugs.webkit.org/show_bug.cgi?id=187982
+        <rdar://problem/42564229>
+
+        Reviewed by Dean Jackson.
+
+        Test: fast/canvas/webgl/webgl2-glsl3-compile.html
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
+        * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
+        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
+        (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
+        (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
+        * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2018-07-30  Justin Fan  <justin_fan@apple.com>
+
         Match GraphicsContext3D with correct virtual screen using registryID
         https://bugs.webkit.org/show_bug.cgi?id=188072
         <rdar://problem/42634940>
index 19181e4..fe8375b 100644 (file)
@@ -583,7 +583,7 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can
 
 #if ENABLE(WEBGL2)
     if (type == "webgl2")
-        attributes.useGLES3 = true;
+        attributes.isWebGL2 = true;
 #endif
 
     if (isPendingPolicyResolution) {
@@ -613,7 +613,7 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can
 #if ENABLE(WEBGL2) && PLATFORM(MAC)
     // glTexStorage() was only added to Core in OpenGL 4.2.
     // However, according to https://developer.apple.com/opengl/capabilities/ all Apple GPUs support this extension.
-    if (attributes.useGLES3 && !extensions.supports("GL_ARB_texture_storage"))
+    if (attributes.isWebGL2 && !extensions.supports("GL_ARB_texture_storage"))
         return nullptr;
 #endif
 
index 0d3da5e..32a7bbb 100644 (file)
@@ -48,7 +48,7 @@ struct GraphicsContext3DAttributes {
     // Additional attributes.
     bool forceSoftwareRenderer { false };
     bool shareResources { true };
-    bool useGLES3 { false };
+    bool isWebGL2 { false };
     bool noExtensions { false };
     float devicePixelRatio { 1 };
     PowerPreference initialPowerPreference { PowerPreference::Default };
index 40ec39e..bad445d 100644 (file)
@@ -81,7 +81,7 @@ public:
 
 #if USE(OPENGL)
 
-static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool useGLES3, bool allowOfflineRenderers)
+static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool isWebGL2, bool allowOfflineRenderers)
 {
     attribs.clear();
     
@@ -118,11 +118,11 @@ static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBi
         attribs.append(static_cast<CGLPixelFormatAttribute>(4));
     }
 
-    if (useGLES3) {
-        // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 3.2 context, we should instead back it with ANGLE.
-        // Use an OpenGL 3.2 context for now until the ANGLE backend is ready.
+    if (isWebGL2) {
+        // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 4 context, we should instead back it with ANGLE.
+        // Use an OpenGL 4 context for now until the ANGLE backend is ready.
         attribs.append(kCGLPFAOpenGLProfile);
-        attribs.append(static_cast<CGLPixelFormatAttribute>(kCGLOGLPVersion_3_2_Core));
+        attribs.append(static_cast<CGLPixelFormatAttribute>(kCGLOGLPVersion_GL4_Core));
     }
         
     attribs.append(static_cast<CGLPixelFormatAttribute>(0));
@@ -244,14 +244,21 @@ static void setGPUByDisplayMask(PlatformGraphicsContext3D contextObj, CGLPixelFo
 
 GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle, GraphicsContext3D* sharedContext)
     : m_attrs(attrs)
-#if PLATFORM(IOS)
-    , m_compiler(SH_ESSL_OUTPUT)
-#endif
     , m_private(std::make_unique<GraphicsContext3DPrivate>(this))
 {
+#if PLATFORM(IOS)
+    if (m_attrs.isWebGL2)
+        m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT, SH_WEBGL2_SPEC);
+    else
+        m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT);
+#else
+    if (m_attrs.isWebGL2)
+        m_compiler = ANGLEWebKitBridge(SH_GLSL_410_CORE_OUTPUT, SH_WEBGL2_SPEC);
+#endif
+
 #if USE(OPENGL_ES)
     UNUSED_PARAM(hostWindow);
-    EAGLRenderingAPI api = m_attrs.useGLES3 ? kEAGLRenderingAPIOpenGLES3 : kEAGLRenderingAPIOpenGLES2;
+    EAGLRenderingAPI api = m_attrs.isWebGL2 ? kEAGLRenderingAPIOpenGLES3 : kEAGLRenderingAPIOpenGLES2;
     if (!sharedContext)
         m_contextObj = [[EAGLContext alloc] initWithAPI:api];
     else
@@ -284,19 +291,19 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
     m_powerPreferenceUsedForCreation = GraphicsContext3DPowerPreference::Default;
 #endif
 
-    setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers());
+    setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.isWebGL2, allowOfflineRenderers());
     CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
 
     if (!numPixelFormats) {
-        setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers());
+        setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.isWebGL2, allowOfflineRenderers());
         CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
 
         if (!numPixelFormats) {
-            setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers());
+            setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.isWebGL2, allowOfflineRenderers());
             CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
 
             if (!attrs.forceSoftwareRenderer && !numPixelFormats) {
-                setPixelFormat(attribs, 32, 16, false, false, true, false, attrs.useGLES3, allowOfflineRenderers());
+                setPixelFormat(attribs, 32, 16, false, false, true, false, attrs.isWebGL2, allowOfflineRenderers());
                 CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
                 useMultisampling = false;
             }
@@ -335,7 +342,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
         return;
     }
 
-    m_isForWebGL2 = attrs.useGLES3;
+    m_isForWebGL2 = attrs.isWebGL2;
 
     // Set the current context to the one given to us.
     CGLSetCurrentContext(m_contextObj);
index 3437952..f41236e 100644 (file)
@@ -400,9 +400,13 @@ bool GraphicsContext3D::checkVaryingsPacking(Platform3DObject vertexShader, Plat
 
     GC3Dint maxVaryingVectors = 0;
 #if !USE(OPENGL_ES)
-    GC3Dint maxVaryingFloats = 0;
-    ::glGetIntegerv(GL_MAX_VARYING_FLOATS, &maxVaryingFloats);
-    maxVaryingVectors = maxVaryingFloats / 4;
+    if (m_isForWebGL2)
+        ::glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryingVectors);
+    else {
+        GC3Dint maxVaryingFloats = 0;
+        ::glGetIntegerv(GL_MAX_VARYING_FLOATS, &maxVaryingFloats);
+        maxVaryingVectors = maxVaryingFloats / 4;
+    }
 #else
     ::glGetIntegerv(MAX_VARYING_VECTORS, &maxVaryingVectors);
 #endif
index 0c083de..a026e8c 100644 (file)
@@ -93,7 +93,7 @@ RefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3DAttributes
 
 #if USE(LIBEPOXY) && USE(OPENGL_ES)
     // Bail if GLES3 was requested but cannot be provided.
-    if (attributes.useGLES3 && !epoxy_is_desktop_gl() && epoxy_gl_version() < 30)
+    if (attributes.isWebGL2 && !epoxy_is_desktop_gl() && epoxy_gl_version() < 30)
         return nullptr;
 #endif
 
@@ -195,7 +195,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, Hos
     }
 #else
     // Adjust the shader specification depending on whether GLES3 (i.e. WebGL2 support) was requested.
-    m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT, m_attrs.useGLES3 ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC);
+    m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT, m_attrs.isWebGL2 ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC);
 #endif
 
     // ANGLE initialization.