summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-11-08 16:36:00 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-11-08 16:36:00 -0700
commit1574611faf9d9106cf167d277238b8c2662beabb (patch)
tree3d4a893d06d78602c12cb6cbfd82ba7da8f31a20 /src
parent48863cdd0a912f34d54bdc312485241a970a9fba (diff)
Fix minor logic error in get_queued_prim() which caused flushing when there was still room in the prim queue.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/draw/draw_prim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_prim.c b/src/mesa/pipe/draw/draw_prim.c
index 94f6df56df..baae6e98c5 100644
--- a/src/mesa/pipe/draw/draw_prim.c
+++ b/src/mesa/pipe/draw/draw_prim.c
@@ -60,6 +60,10 @@ static void draw_prim_queue_flush( struct draw_context *draw )
struct draw_stage *first = draw->pipeline.first;
unsigned i;
+ if (0)
+ printf("Flushing with %d prims, %d verts\n",
+ draw->pq.queue_nr, draw->vs.queue_nr);
+
/* Make sure all vertices are available:
*/
if (draw->vs.queue_nr)
@@ -137,11 +141,13 @@ static struct prim_header *get_queued_prim( struct draw_context *draw,
// fprintf(stderr, "v");
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE_INVALIDATE );
}
- else if (draw->pq.queue_nr + 1 >= PRIM_QUEUE_LENGTH) {
+ else if (draw->pq.queue_nr == PRIM_QUEUE_LENGTH) {
// fprintf(stderr, "p");
draw_do_flush( draw, DRAW_FLUSH_PRIM_QUEUE );
}
+ assert(draw->pq.queue_nr < PRIM_QUEUE_LENGTH);
+
return &draw->pq.queue[draw->pq.queue_nr++];
}