Bug 1232462. Only ask for a higher version of GLSL when using WebGL2. r=jgilbert a=sylvestre
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 16 Dec 2015 16:14:37 -0500
changeset 298053 5900cd9ccb59b222a03f14c7673edaf7d5afbd9a
parent 298052 97e5908d03d6f2726ff8776dc93c29fcdd19bc2c
child 298054 c1a3159224ae103209fbb82802fc927aab4e20a5
push id8857
push userkwierso@gmail.com
push dateMon, 28 Dec 2015 16:46:13 +0000
treeherdermozilla-aurora@5628bb302871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, sylvestre
bugs1232462
milestone45.0a2
Bug 1232462. Only ask for a higher version of GLSL when using WebGL2. r=jgilbert a=sylvestre This fixes the situation for now. I'm going to try to work out what should actually be happening here with ANGLE. See also: https://bugs.chromium.org/p/angleproject/issues/detail?id=1256
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -123,17 +123,23 @@ ShaderOutput(gl::GLContext* gl)
 
 webgl::ShaderValidator*
 WebGLContext::CreateShaderValidator(GLenum shaderType) const
 {
     if (mBypassShaderValidation)
         return nullptr;
 
     ShShaderSpec spec = IsWebGL2() ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC;
-    ShShaderOutput outputLanguage = ShaderOutput(gl);
+    ShShaderOutput outputLanguage = gl->IsGLES() ? SH_ESSL_OUTPUT
+                                                 : SH_GLSL_OUTPUT;
+
+    // If we're using WebGL2 we want a more specific version of GLSL
+    if (IsWebGL2())
+        outputLanguage = ShaderOutput(gl);
+
     ShBuiltInResources resources;
     memset(&resources, 0, sizeof(resources));
     ShInitBuiltInResources(&resources);
 
     resources.HashFunction = webgl::IdentifierHashFunc;
 
     resources.MaxVertexAttribs = mGLMaxVertexAttribs;
     resources.MaxVertexUniformVectors = mGLMaxVertexUniformVectors;