Bug 1297924 - Update shader validator due to interface change. r=jgilbert
☠☠ backed out by a495d31313af ☠ ☠
authorMorris Tseng <mtseng@mozilla.com>
Wed, 07 Sep 2016 14:09:08 +0800
changeset 312949 1c9f6480b0e43225552da0957eae29a6b0da3298
parent 312948 64a77898c426e8fbcb41246891aa8da48d8be76a
child 312950 25f7b5f0dee36a87199838939d63d6acf8935abd
push id30665
push usercbook@mozilla.com
push dateWed, 07 Sep 2016 15:20:43 +0000
treeherdermozilla-central@95acb9299faf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1297924
milestone51.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 1297924 - Update shader validator due to interface change. r=jgilbert MozReview-Commit-ID: 7d8bX6ZFOcL
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -290,26 +290,23 @@ ShaderValidator::CanLinkTo(const ShaderV
     const auto& fragVaryings = ShGetVaryings(mHandle);
     if (!vertVaryings || !fragVaryings) {
         nsPrintfCString error("Could not create varying list.");
         *out_log = error;
         return false;
     }
 
     {
-        std::vector<ShVariableInfo> staticUseVaryingList;
+        std::vector<sh::ShaderVariable> staticUseVaryingList;
 
         for (const auto& fragVarying : *fragVaryings) {
-            const ShVariableInfo varInfo = { fragVarying.type,
-                                             (int)fragVarying.elementCount() };
-
             static const char prefix[] = "gl_";
             if (StartsWith(fragVarying.name, prefix)) {
                 if (fragVarying.staticUse) {
-                    staticUseVaryingList.push_back(varInfo);
+                    staticUseVaryingList.push_back(fragVarying);
                 }
                 continue;
             }
 
             bool definedInVertShader = false;
             bool staticVertUse = false;
 
             for (const auto& vertVarying : *vertVaryings) {
@@ -333,23 +330,22 @@ ShaderValidator::CanLinkTo(const ShaderV
                 nsPrintfCString error("Varying `%s` has static-use in the frag"
                                       " shader, but is undeclared in the vert"
                                       " shader.", fragVarying.name.c_str());
                 *out_log = error;
                 return false;
             }
 
             if (staticVertUse && fragVarying.staticUse) {
-                staticUseVaryingList.push_back(varInfo);
+                staticUseVaryingList.push_back(fragVarying);
             }
         }
 
         if (!ShCheckVariablesWithinPackingLimits(mMaxVaryingVectors,
-                                                 staticUseVaryingList.data(),
-                                                 staticUseVaryingList.size()))
+                                                 staticUseVaryingList))
         {
             *out_log = "Statically used varyings do not fit within packing limits. (see"
                        " GLSL ES Specification 1.0.17, p111)";
             return false;
         }
     }
 
     if (shaderVersion == 100) {