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

Eric Anholt anholt at kemper.freedesktop.org
Thu Jun 23 20:56:30 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jun 17 13:17:34 2011 -0700

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

In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp at vmware.com>

---

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

diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c
index 15e5895..1de290f 100644
--- a/src/mesa/vbo/vbo_rebase.c
+++ b/src/mesa/vbo/vbo_rebase.c
@@ -78,8 +78,7 @@ 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]->StrideB &&
-	  arrays[i]->BufferObj->Name == 0)
+      if (arrays[i]->BufferObj->Name == 0)
 	 return GL_FALSE;
 
    return GL_TRUE;




More information about the mesa-commit mailing list