Bug 1297924 - Update shader validator due to interface change. r=jgilbert, a=ritu
☠☠ backed out by 2c332306c030 ☠ ☠
authorMorris Tseng <mtseng@mozilla.com>
Wed, 14 Sep 2016 01:02:00 -0400
changeset 348191 8cff6e89a868269425691011b567e525344e0df3
parent 348190 9ca6bbc6fdb3fc319050026ac09b9a085498f336
child 348192 b63f2bd9ccdf34b2cc6da9620356d4be14ea7bfe
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, ritu
bugs1297924
milestone50.0a2
Bug 1297924 - Update shader validator due to interface change. r=jgilbert, a=ritu MozReview-Commit-ID: 8VSrUepZsmz
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) {