Bug 675634 - import ANGLE r712 - r=upstream
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 02 Aug 2011 18:06:25 -0400
changeset 73693 d6301744afa92dd3efbbbea7ae2856a682c380a2
parent 73692 7813728d68ff9c96278d6612c62268b9f0179671
child 73694 bd2c7e8f102e63cab65ff4adac5d7df0a8e304e1
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersupstream
bugs675634
milestone8.0a1
Bug 675634 - import ANGLE r712 - r=upstream
gfx/angle/README.mozilla
gfx/angle/angle-r712.patch
gfx/angle/src/libGLESv2/VertexDataManager.cpp
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -6,16 +6,17 @@ Current revision: r653
 
 In this order:
   angle-nspr-misc.patch - don't bother with ANGLE_OS detection with NSPR
   angle-renaming.patch - rename debug.h to compilerdebug.h to avoid conflict in our makefiles
   angle-intrinsic-msvc2005.patch - work around a MSVC 2005 compile error
   angle-amap-arev-fix.patch - plain bug fix, this is ANGLE r699
   angle-r702.patch - this is ANGLE r702
   angle-limit-identifiers-to-250-chars.patch - see bug 675625
+  angle-r712.patch - this is ANGLE r712
 
 In addition to these patches, the Makefile.in files are ours, they're not present in upsteam ANGLE.
 
 == How to update this ANGLE copy ==
 
 1. Unapply patches
 2. Apply diff with new ANGLE version
 3. Reapply patches.
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-r712.patch
@@ -0,0 +1,42 @@
+# HG changeset patch
+# Parent 88a5c8710f5cffd568bc21226118cb567850ce28
+diff --git a/gfx/angle/src/libGLESv2/VertexDataManager.cpp b/gfx/angle/src/libGLESv2/VertexDataManager.cpp
+--- a/gfx/angle/src/libGLESv2/VertexDataManager.cpp
++++ b/gfx/angle/src/libGLESv2/VertexDataManager.cpp
+@@ -134,34 +134,34 @@ GLenum VertexDataManager::prepareVertexD
+                 if (staticBuffer->size() == 0)
+                 {
+                     int totalCount = buffer->size() / attribs[i].stride();
+                     staticBuffer->addRequiredSpace(spaceRequired(attribs[i], totalCount));
+                 }
+                 else if (staticBuffer->lookupAttribute(attribs[i]) == -1)
+                 {
+                     // This static buffer doesn't have matching attributes, so fall back to using the streaming buffer
+-                    buffer->invalidateStaticData();
+-
+                     // Add the space of all previous attributes belonging to the invalidated static buffer to the streaming buffer
+                     for (int previous = 0; previous < i; previous++)
+                     {
+                         if (translated[previous].active && attribs[previous].mArrayEnabled)
+                         {
+                             Buffer *previousBuffer = attribs[previous].mBoundBuffer.get();
+                             StaticVertexBuffer *previousStaticBuffer = previousBuffer ? previousBuffer->getStaticVertexBuffer() : NULL;
+ 
+                             if (staticBuffer == previousStaticBuffer)
+                             {
+                                 mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[previous], count));
+                             }
+                         }
+                     }
+ 
+                     mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
++
++                    buffer->invalidateStaticData();
+                 }    
+             }
+             else
+             {
+                 mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
+             }
+         }
+     }
--- a/gfx/angle/src/libGLESv2/VertexDataManager.cpp
+++ b/gfx/angle/src/libGLESv2/VertexDataManager.cpp
@@ -134,34 +134,34 @@ GLenum VertexDataManager::prepareVertexD
                 if (staticBuffer->size() == 0)
                 {
                     int totalCount = buffer->size() / attribs[i].stride();
                     staticBuffer->addRequiredSpace(spaceRequired(attribs[i], totalCount));
                 }
                 else if (staticBuffer->lookupAttribute(attribs[i]) == -1)
                 {
                     // This static buffer doesn't have matching attributes, so fall back to using the streaming buffer
-                    buffer->invalidateStaticData();
-
                     // Add the space of all previous attributes belonging to the invalidated static buffer to the streaming buffer
                     for (int previous = 0; previous < i; previous++)
                     {
                         if (translated[previous].active && attribs[previous].mArrayEnabled)
                         {
                             Buffer *previousBuffer = attribs[previous].mBoundBuffer.get();
                             StaticVertexBuffer *previousStaticBuffer = previousBuffer ? previousBuffer->getStaticVertexBuffer() : NULL;
 
                             if (staticBuffer == previousStaticBuffer)
                             {
                                 mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[previous], count));
                             }
                         }
                     }
 
                     mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
+
+                    buffer->invalidateStaticData();
                 }    
             }
             else
             {
                 mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
             }
         }
     }