Bug 1207288. Enable the ANGLE shader validator for WebGL 2. r=jgilbert
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 13 Oct 2015 14:40:26 -0400
changeset 267773 3c2089b24cefd2dc571507b3ef586b2fcb0b59a1
parent 267772 bd6226d81b60790f8113aea75250f114de1dcc47
child 267774 bbea1ed9586afaec8876aba23aebae464f123f4f
push id29530
push usercbook@mozilla.com
push dateThu, 15 Oct 2015 09:53:07 +0000
treeherdermozilla-central@e193b4da0a8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1207288
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1207288. Enable the ANGLE shader validator for WebGL 2. r=jgilbert ANGLE's shader parser has much better support for ES3 now. Let's no longer disable it by default.
dom/canvas/WebGL2Context.cpp
dom/canvas/WebGLShaderValidator.cpp
dom/canvas/test/webgl-mochitest/webgl-util.js
--- a/dom/canvas/WebGL2Context.cpp
+++ b/dom/canvas/WebGL2Context.cpp
@@ -175,14 +175,12 @@ WebGLContext::InitWebGL2()
     }
 
     mBoundTransformFeedbackBuffers.SetLength(mGLMaxTransformFeedbackSeparateAttribs);
     mBoundUniformBuffers.SetLength(mGLMaxUniformBufferBindings);
 
     mDefaultTransformFeedback = new WebGLTransformFeedback(this, 0);
     mBoundTransformFeedback = mDefaultTransformFeedback;
 
-    mBypassShaderValidation = true;
-
     return true;
 }
 
 } // namespace mozilla
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -94,17 +94,17 @@ ChooseValidatorCompileOptions(const ShBu
 ////////////////////////////////////////
 
 webgl::ShaderValidator*
 WebGLContext::CreateShaderValidator(GLenum shaderType) const
 {
     if (mBypassShaderValidation)
         return nullptr;
 
-    ShShaderSpec spec = SH_WEBGL_SPEC;
+    ShShaderSpec spec = IsWebGL2() ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC;
     ShShaderOutput outputLanguage = gl->IsGLES() ? SH_ESSL_OUTPUT
                                                  : SH_GLSL_OUTPUT;
 
     ShBuiltInResources resources;
     memset(&resources, 0, sizeof(resources));
     ShInitBuiltInResources(&resources);
 
     resources.HashFunction = webgl::IdentifierHashFunc;
--- a/dom/canvas/test/webgl-mochitest/webgl-util.js
+++ b/dom/canvas/test/webgl-mochitest/webgl-util.js
@@ -57,16 +57,17 @@ WebGLUtil = (function() {
 
     return gl;
   }
 
   function withWebGL2(canvasId, callback, onFinished) {
     var prefArrArr = [
       ['webgl.force-enabled', true],
       ['webgl.disable-angle', true],
+      ['webgl.bypass-shader-validation', true],
       ['webgl.enable-prototype-webgl2', true],
     ];
     var prefEnv = {'set': prefArrArr};
     SpecialPowers.pushPrefEnv(prefEnv, function() {
       var canvas = document.getElementById(canvasId);
 
       var gl = null;
       try {