Mesa (master): Revert "vbo: Don't discount stride == 0 for testing all varyings in VBOs."

Eric Anholt anholt at kemper.freedesktop.org
Sat Oct 1 23:31:46 PDT 2011


Module: Mesa
Branch: master
Commit: 42769c2da5c986e38a1bd4ef7dbcb6623968ce88
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=42769c2da5c986e38a1bd4ef7dbcb6623968ce88

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Sep 26 16:22:17 2011 -0700

Revert "vbo: Don't discount stride == 0 for testing all varyings in VBOs."

This reverts commit d631c19db47181129811080bfa772b210d762d4d.

The commit was broken, and ended up returning false all the time
because nobody in the world binds every single possible vertex array.
On further reflection, we don't want to discount stride == 0: This
function is just used for deciding to calculate whether to compute the
bonuds on the index, and there's no sense in computing index bounds
when stride == 0.

For the separate question of "how much data do I upload for this
vertex element?", the i965 driver was fixed to upload the data.

Fixes a regression of about 2x in 3DMMES, and most importantly, makes
Hammerfight playable.

---

 src/mesa/vbo/vbo_rebase.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c
index a1eab75..97c8d12 100644
--- a/src/mesa/vbo/vbo_rebase.c
+++ b/src/mesa/vbo/vbo_rebase.c
@@ -78,7 +78,8 @@ GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] )
    GLuint i;
    
    for (i = 0; i < VERT_ATTRIB_MAX; i++)
-      if (arrays[i]->BufferObj->Name == 0)
+      if (arrays[i]->StrideB &&
+	  arrays[i]->BufferObj->Name == 0)
 	 return GL_FALSE;
 
    return GL_TRUE;



More information about the mesa-commit mailing list