Cell: fix a recursive flushing bug

This commit is contained in:
Brian
2008-01-26 14:14:56 -07:00
parent d4bd6ca816
commit 856db7dee6
3 changed files with 22 additions and 1 deletions
+18
View File
@@ -31,14 +31,30 @@
#include "cell_flush.h"
#include "cell_spu.h"
#include "cell_render.h"
#include "pipe/draw/draw_context.h"
void
cell_flush(struct pipe_context *pipe, unsigned flags)
{
struct cell_context *cell = cell_context(pipe);
draw_flush( cell->draw );
cell_flush_int(pipe, flags);
}
/** internal flush */
void
cell_flush_int(struct pipe_context *pipe, unsigned flags)
{
static boolean flushing = FALSE; /* recursion catcher */
struct cell_context *cell = cell_context(pipe);
uint i;
ASSERT(!flushing);
flushing = TRUE;
if (flags & PIPE_FLUSH_WAIT) {
uint *cmd = (uint *) cell_batch_alloc(cell, sizeof(uint));
*cmd = CELL_CMD_FINISH;
@@ -60,4 +76,6 @@ cell_flush(struct pipe_context *pipe, unsigned flags)
assert(k == CELL_CMD_FINISH);
}
}
flushing = FALSE;
}
+3
View File
@@ -32,4 +32,7 @@
extern void
cell_flush(struct pipe_context *pipe, unsigned flags);
extern void
cell_flush_int(struct pipe_context *pipe, unsigned flags);
#endif
+1 -1
View File
@@ -166,7 +166,7 @@ cell_vbuf_draw(struct vbuf_render *vbr,
#if 01
/* XXX this is temporary */
cell_flush(&cell->pipe, PIPE_FLUSH_WAIT);
cell_flush_int(&cell->pipe, PIPE_FLUSH_WAIT);
#endif
}