Mesa (7.10): vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()

Brian Paul brianp at kemper.freedesktop.org
Fri Jun 10 21:26:27 UTC 2011


Module: Mesa
Branch: 7.10
Commit: 8a78e6cf804f58c0bc99278624bc30c3dea867b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a78e6cf804f58c0bc99278624bc30c3dea867b1

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jun 10 13:07:48 2011 -0600

vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()

See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 62811057f41bf7c027da6156a44383266c7f3952)

---

 src/mesa/vbo/vbo_save_draw.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 533c150..6f06794 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -244,7 +244,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data)
 
    FLUSH_CURRENT(ctx, 0);
 
-   if (node->prim_count > 0 && node->count > 0) {
+   if (node->prim_count > 0) {
 
       if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END &&
 	  node->prim[0].begin) {
@@ -284,14 +284,16 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data)
       if (ctx->NewState)
 	 _mesa_update_state( ctx );
 
-      vbo_context(ctx)->draw_prims(ctx, 
-                                   save->inputs, 
-                                   node->prim, 
-                                   node->prim_count,
-                                   NULL,
-                                   GL_TRUE,
-                                   0,	/* Node is a VBO, so this is ok */
-                                   node->count - 1);
+      if (node->count > 0) {
+         vbo_context(ctx)->draw_prims(ctx, 
+                                      save->inputs, 
+                                      node->prim, 
+                                      node->prim_count,
+                                      NULL,
+                                      GL_TRUE,
+                                      0,    /* Node is a VBO, so this is ok */
+                                      node->count - 1);
+      }
    }
 
    /* Copy to current?




More information about the mesa-commit mailing list