diff options
author | Keith Whitwell <[email protected]> | 2004-09-02 07:33:41 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2004-09-02 07:33:41 +0000 |
commit | f3d960054eed561addcd48c08e88e4de6874e46a (patch) | |
tree | d2cf75202579062472e8ad65809efd9d16890647 /src/mesa/drivers/dri/r200 | |
parent | 72b395fbbae9e32793432917f20672e409a1ff87 (diff) |
r200-maybe-flush-less-3.diff
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_tcl.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index b613911b06d..a00d4b72250 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -140,21 +140,37 @@ static GLboolean discrete_prim[0x10] = { static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) { - if (rmesa->dma.flush) - rmesa->dma.flush( rmesa ); + if (rmesa->dma.flush == r200FlushElts && + rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { - r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) + - rmesa->hw.max_state_size + ELTS_BUFSZ(nr) ); - - r200EmitAOS( rmesa, - rmesa->tcl.aos_components, - rmesa->tcl.nr_aos_components, 0 ); + GLushort *dest = (GLushort *)(rmesa->store.cmd_buf + + rmesa->store.cmd_used); + + rmesa->store.cmd_used += nr*2; + + return dest; + } + else { + if (rmesa->dma.flush) + rmesa->dma.flush( rmesa ); + + r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) + + rmesa->hw.max_state_size + ELTS_BUFSZ(nr) ); - return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr ); + r200EmitAOS( rmesa, + rmesa->tcl.aos_components, + rmesa->tcl.nr_aos_components, 0 ); + + return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr ); + } } -#define CLOSE_ELTS() R200_NEWPRIM( rmesa ) +#define CLOSE_ELTS() \ +do { \ + if (0) R200_NEWPRIM( rmesa ); \ +} \ +while (0) /* TODO: Try to extend existing primitive if both are identical, |