Bug 675634 - import ANGLE r712 - r=upstream, a=clegnitto
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 02 Aug 2011 18:06:25 -0400
changeset 70592 99e2010c484ca50f14cafb73fd341be4367a2952
parent 70591 8c2a57408242e730ba982a425707c2ec71aefa7c
child 70593 5290a61c6998a636aa9b170346c2eaef4801e91d
push id141
push userbjacob@mozilla.com
push dateTue, 02 Aug 2011 22:11:00 +0000
treeherdermozilla-beta@99e2010c484c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersupstream, clegnitto
bugs675634
milestone6.0
Bug 675634 - import ANGLE r712 - r=upstream, a=clegnitto
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));
             }
         }
     }