diff options
author | Pauli Nieminen <[email protected]> | 2009-08-26 22:24:25 +0300 |
---|---|---|
committer | Pauli Nieminen <[email protected]> | 2009-08-27 00:01:56 +0300 |
commit | 97029c1860e8a99448ac157408e71bea3aa2559f (patch) | |
tree | baa7b07538918a1777dba13d87ea1fe82e3dcadf /src/mesa/drivers/dri/r200/r200_swtcl.c | |
parent | 72052210516b4cb0e082e0c56822cd33b1562630 (diff) |
radeon/r200/r300: Fix swtcl flushing not to invalidate dma region.
We were check command buffer sizes too alte so allocated dma regions
were freed before relocations so space checking failed.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_swtcl.c')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_swtcl.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index 13bd6ac4e2c..6b7279e8db5 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -204,7 +204,21 @@ static void r200SetVertexFormat( GLcontext *ctx ) static void r200RenderStart( GLcontext *ctx ) { + const int vertex_array_size = 7; + const int prim_size = 3; + r200ContextPtr rmesa = R200_CONTEXT( ctx ); r200SetVertexFormat( ctx ); + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s\n", __func__); + if (!rmesa->radeon.swtcl.primitive_counter) { + if (rcommonEnsureCmdBufSpace(&rmesa->radeon, + radeonCountStateEmitSize(&rmesa->radeon) + + vertex_array_size + prim_size, + __FUNCTION__)) + rmesa->radeon.swtcl.primitive_counter = 0; + else + rmesa->radeon.swtcl.primitive_counter = 1; + } } @@ -268,9 +282,8 @@ void r200ChooseVertexState( GLcontext *ctx ) void r200_swtcl_flush(GLcontext *ctx, uint32_t current_offset) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - rcommonEnsureCmdBufSpace(&rmesa->radeon, - radeonCountStateEmitSize(&rmesa->radeon) + (12*sizeof(int)), - __FUNCTION__); + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s\n", __func__); radeonEmitState(&rmesa->radeon); @@ -284,6 +297,8 @@ void r200_swtcl_flush(GLcontext *ctx, uint32_t current_offset) rmesa->radeon.swtcl.hw_primitive, rmesa->radeon.swtcl.numverts); + rmesa->radeon.swtcl.primitive_counter = 0; + } /**************************************************************************/ @@ -890,6 +905,7 @@ void r200InitSwtcl( GLcontext *ctx ) init_rast_tab(); firsttime = 0; } + rmesa->radeon.swtcl.primitive_counter = 0; tnl->Driver.Render.Start = r200RenderStart; tnl->Driver.Render.Finish = r200RenderFinish; |