Mesa (master): st/mesa: fix all_varyings_in_vbos() regression

Brian Paul brianp at kemper.freedesktop.org
Fri Jun 24 16:42:28 UTC 2011


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jun 24 10:41:42 2011 -0600

st/mesa: fix all_varyings_in_vbos() regression

Fixes regression from d631c19db47181129811080bfa772b210d762d4d.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626

---

 src/mesa/state_tracker/st_draw.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index fac0ab7..5040c6f 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -233,6 +233,22 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
 }
 
 
+/**
+ * This is very similar to vbo_all_varyings_in_vbos() but we test
+ * the stride.  See bug 38626.
+ */
+static GLboolean
+all_varyings_in_vbos(const struct gl_client_array *arrays[])
+{
+   GLuint i;
+   
+   for (i = 0; i < VERT_ATTRIB_MAX; i++)
+      if (arrays[i]->StrideB && !_mesa_is_bufferobj(arrays[i]->BufferObj))
+	 return GL_FALSE;
+
+   return GL_TRUE;
+}
+
 
 /**
  * Examine the active arrays to determine if we have interleaved
@@ -648,7 +664,7 @@ st_draw_vbo(struct gl_context *ctx,
    if (ib) {
       /* Gallium probably doesn't want this in some cases. */
       if (!index_bounds_valid)
-         if (!vbo_all_varyings_in_vbos(arrays))
+         if (!all_varyings_in_vbos(arrays))
             vbo_get_minmax_index(ctx, prims, ib, &min_index, &max_index);
 
       for (i = 0; i < nr_prims; i++) {




More information about the mesa-commit mailing list