Bug 1301381 - Clean up VaryingPacking::packVarying - r=jrmuizel
authorEdwin Flores <edwin@mozilla.com>
Thu, 17 Nov 2016 10:09:26 +0000
changeset 323045 a72de75573c855e675328d3ceba32ebd84fab983
parent 323044 0f869d4c93ef11e91cb2190e5fed03404d21fdf4
child 323046 c5f032bd4cf861c3058f244140399f7fb2fea663
push id30967
push userphilringnalda@gmail.com
push dateFri, 18 Nov 2016 03:21:38 +0000
treeherdermozilla-central@8e476f8bd52d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1301381
milestone53.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 1301381 - Clean up VaryingPacking::packVarying - r=jrmuizel
gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp
--- a/gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp
@@ -68,16 +68,20 @@ bool VaryingPacking::packVarying(const P
     varyingRows           = gl::VariableRowCount(transposedType);
     varyingColumns        = gl::VariableColumnCount(transposedType);
 
     // "Arrays of size N are assumed to take N times the size of the base type"
     varyingRows *= varying.elementCount();
 
     unsigned int maxVaryingVectors = static_cast<unsigned int>(mRegisterMap.size());
 
+    if (varyingRows > maxVaryingVectors) {
+        return false;
+    }
+
     // "For 2, 3 and 4 component variables packing is started using the 1st column of the 1st row.
     // Variables are then allocated to successive rows, aligning them to the 1st column."
     if (varyingColumns >= 2 && varyingColumns <= 4)
     {
         for (unsigned int row = 0; row <= maxVaryingVectors - varyingRows; ++row)
         {
             if (isFree(row, 0, varyingRows, varyingColumns))
             {