Bug 649233 - Include ANGLE r611. r=joe a=LegNeato
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 12 Apr 2011 00:36:13 -0700
changeset 63418 1ae9e61776a894acc28309914d92c26f2880a714
parent 63417 e217fcf59016a79ee0c40f9f22a83d7873e7efda
child 63419 debc1ec252229e602575ad47bfa70acd9b3c56e4
push id62
push userjdrew@mozilla.com
push dateTue, 12 Apr 2011 09:01:14 +0000
reviewersjoe, LegNeato
bugs649233
milestone2.0.1pre
Bug 649233 - Include ANGLE r611. r=joe a=LegNeato
gfx/angle/src/common/version.h
gfx/angle/src/compiler/preprocessor/atom.c
gfx/angle/src/libGLESv2/Program.cpp
--- a/gfx/angle/src/common/version.h
+++ b/gfx/angle/src/common/version.h
@@ -1,10 +1,10 @@
 #define MAJOR_VERSION 0
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 541
+#define BUILD_REVISION 611
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
 
 #define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION)
 #define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION)
--- a/gfx/angle/src/compiler/preprocessor/atom.c
+++ b/gfx/angle/src/compiler/preprocessor/atom.c
@@ -177,22 +177,23 @@ static int HashString2(const char *s)
  */
 
 static int AddString(StringTable *stable, const char *s)
 {
     int len, loc;
     char *str;
 
     len = (int) strlen(s);
-    if (stable->nextFree + len + 1 >= stable->size) {
+    while (stable->nextFree + len + 1 >= stable->size) {
         assert(stable->size < 1000000);
         str = (char *) malloc(stable->size*2);
         memcpy(str, stable->strings, stable->size);
         free(stable->strings);
         stable->strings = str;
+        stable->size = stable->size*2;
     }
     loc = stable->nextFree;
     strcpy(&stable->strings[loc], s);
     stable->nextFree += len + 1;
     return loc;
 } // AddString
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
--- a/gfx/angle/src/libGLESv2/Program.cpp
+++ b/gfx/angle/src/libGLESv2/Program.cpp
@@ -2727,17 +2727,22 @@ GLint Program::getActiveUniformMaxLength
 {
     int maxLength = 0;
 
     unsigned int numUniforms = mUniforms.size();
     for (unsigned int uniformIndex = 0; uniformIndex < numUniforms; uniformIndex++)
     {
         if (!mUniforms[uniformIndex]->name.empty() && mUniforms[uniformIndex]->name.substr(0, 3) != "dx_")
         {
-            maxLength = std::max((int)(undecorate(mUniforms[uniformIndex]->name).length() + 1), maxLength);
+            int length = (int)(undecorate(mUniforms[uniformIndex]->name).length() + 1);
+            if (mUniforms[uniformIndex]->arraySize != 1)
+            {
+                length += 3;  // Counting in "[0]".
+            }
+            maxLength = std::max(length, maxLength);
         }
     }
 
     return maxLength;
 }
 
 void Program::flagForDeletion()
 {