Cell: add check to catch recursive batch flushing
authorBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 21:12:33 +0000 (14:12 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 21:15:53 +0000 (14:15 -0700)
src/mesa/pipe/cell/ppu/cell_batch.c

index ab4553f16caefbda0f4a02fe69b8ec293ae47daa..5a25f1b2668acb9c7b30489a41625da35c834170 100644 (file)
 void
 cell_batch_flush(struct cell_context *cell)
 {
+   static boolean flushing = FALSE;
    uint batch = cell->cur_batch;
    const uint size = cell->batch_buffer_size[batch];
    uint spu, cmd_word;
 
+   assert(!flushing);
+
    if (size == 0)
       return;
 
+   flushing = TRUE;
+
    assert(batch < CELL_NUM_BATCH_BUFFERS);
 
    /*
@@ -86,6 +91,8 @@ cell_batch_flush(struct cell_context *cell)
 
    cell->batch_buffer_size[batch] = 0;  /* empty */
    cell->cur_batch = batch;
+
+   flushing = FALSE;
 }