Bug 1446548 - Treat all GLSL versions >=450 as 450. - r=kvark
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 29 Mar 2018 16:54:09 -0700
changeset 411576 d66f4a7d60343c2f9ea8278f5bc35efcad79bb7c
parent 411575 5da47724cb199e2038b545a6b6d6c6b2bff8394e
child 411577 0f848f74c9477f37a8f0035ffe7e5c93bfddf0ae
push id101689
push userjgilbert@mozilla.com
push dateTue, 03 Apr 2018 23:17:43 +0000
treeherdermozilla-inbound@d66f4a7d6034 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1446548
milestone61.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 1446548 - Treat all GLSL versions >=450 as 450. - r=kvark MozReview-Commit-ID: 4i5IAvWNZb
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebGLShaderValidator.h"
 
 #include "gfxPrefs.h"
 #include "GLContext.h"
+#include "mozilla/gfx/Logging.h"
 #include "mozilla/Preferences.h"
 #include "MurmurHash3.h"
 #include "nsPrintfCString.h"
 #include <string>
 #include <vector>
 #include "WebGLContext.h"
 
 namespace mozilla {
@@ -113,19 +114,23 @@ ShaderOutput(gl::GLContext* gl)
         case 140: return SH_GLSL_140_OUTPUT;
         case 150: return SH_GLSL_150_CORE_OUTPUT;
         case 330: return SH_GLSL_330_CORE_OUTPUT;
         case 400: return SH_GLSL_400_CORE_OUTPUT;
         case 410: return SH_GLSL_410_CORE_OUTPUT;
         case 420: return SH_GLSL_420_CORE_OUTPUT;
         case 430: return SH_GLSL_430_CORE_OUTPUT;
         case 440: return SH_GLSL_440_CORE_OUTPUT;
-        case 450: return SH_GLSL_450_CORE_OUTPUT;
         default:
-            MOZ_ASSERT(false, "GFX: Unexpected GLSL version.");
+            if (version >= 450) {
+                // "OpenGL 4.6 is also guaranteed to support all previous versions of the
+                //  OpenGL Shading Language back to version 1.10."
+                return SH_GLSL_450_CORE_OUTPUT;
+            }
+            gfxCriticalNote << "Unexpected GLSL version: " << version;
         }
     }
 
     return SH_GLSL_COMPATIBILITY_OUTPUT;
 }
 
 webgl::ShaderValidator*
 WebGLContext::CreateShaderValidator(GLenum shaderType) const