summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_prim.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-01-28 11:12:11 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-01-28 11:12:11 +0000
commit99f297651198c3424aab202595064d6f5596b2fc (patch)
tree520e3646ebfec2422543ef38ea57e481fd6c54f0 /src/mesa/pipe/draw/draw_prim.c
parenta46181044fd5573895180ee5f1a016c4c1e4a653 (diff)
gallium: only call vertex/prim queue flush when there is something to flush
Diffstat (limited to 'src/mesa/pipe/draw/draw_prim.c')
-rw-r--r--src/mesa/pipe/draw/draw_prim.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/pipe/draw/draw_prim.c b/src/mesa/pipe/draw/draw_prim.c
index 243381aec0..2a612a1673 100644
--- a/src/mesa/pipe/draw/draw_prim.c
+++ b/src/mesa/pipe/draw/draw_prim.c
@@ -63,8 +63,7 @@ static void draw_prim_queue_flush( struct draw_context *draw )
fprintf(stdout,"Flushing with %d prims, %d verts\n",
draw->pq.queue_nr, draw->vs.queue_nr);
- if (draw->pq.queue_nr == 0)
- return;
+ assert (draw->pq.queue_nr != 0);
/* NOTE: we cannot save draw->pipeline->first in a local var because
* draw->pipeline->first is often changed by the first call to tri(),
@@ -109,10 +108,12 @@ void draw_do_flush( struct draw_context *draw, unsigned flags )
if (flags >= DRAW_FLUSH_SHADER_QUEUE) {
- draw_vertex_shader_queue_flush(draw);
+ if (draw->vs.queue_nr)
+ draw_vertex_shader_queue_flush(draw);
if (flags >= DRAW_FLUSH_PRIM_QUEUE) {
- draw_prim_queue_flush(draw);
+ if (draw->pq.queue_nr)
+ draw_prim_queue_flush(draw);
if (flags >= DRAW_FLUSH_VERTEX_CACHE) {
draw_vertex_cache_invalidate(draw);