diff options
author | Pauli Nieminen <[email protected]> | 2009-08-29 00:46:08 +0300 |
---|---|---|
committer | Pauli Nieminen <[email protected]> | 2009-08-29 00:46:57 +0300 |
commit | 0926a5f4a110926711d0f8a4eb297dc772b09aa2 (patch) | |
tree | e2683648e298c0524d1640c5bea56660f8eeff0a /src/mesa/drivers/dri/r200 | |
parent | 55e7abf81f3c515919ef8ff69125c7aafd274716 (diff) |
radeon: Fix swtcl emit pediction.
Problem was to find the correct place to run prediction. Only place that is
called for every primitive is ALLOC_VERTS so we have to do prediction there
before allocation.
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_swtcl.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index 3d4e7011557..0e7d24e7e96 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -201,9 +201,10 @@ static void r200SetVertexFormat( GLcontext *ctx ) } } -static void r200_predict_emit_size( GLcontext *ctx ) +static void r200_predict_emit_size( r200ContextPtr rmesa ) { - r200ContextPtr rmesa = R200_CONTEXT( ctx ); + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s\n", __func__); const int vertex_array_size = 7; const int prim_size = 3; if (!rmesa->radeon.swtcl.emit_prediction) { @@ -226,7 +227,6 @@ static void r200RenderStart( GLcontext *ctx ) r200SetVertexFormat( ctx ); if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s\n", __func__); - r200_predict_emit_size( ctx ); } @@ -310,7 +310,6 @@ void r200_swtcl_flush(GLcontext *ctx, uint32_t current_offset) rmesa->radeon.cmdbuf.cs->cdw - rmesa->radeon.swtcl.emit_prediction ); rmesa->radeon.swtcl.emit_prediction = 0; - r200_predict_emit_size( ctx ); } @@ -358,11 +357,21 @@ static void r200ResetLineStipple( GLcontext *ctx ); #define HAVE_POLYGONS 1 #define HAVE_ELTS 0 +static void* r200_alloc_verts( r200ContextPtr rmesa, GLuint n, GLuint size) +{ + void *rv; + do { + r200_predict_emit_size( rmesa ); + rv = rcommonAllocDmaLowVerts( &rmesa->radeon, n, size * 4 ); + } while(!rv); + return rv; +} + #undef LOCAL_VARS #undef ALLOC_VERTS #define CTX_ARG r200ContextPtr rmesa #define GET_VERTEX_DWORDS() rmesa->radeon.swtcl.vertex_size -#define ALLOC_VERTS( n, size ) rcommonAllocDmaLowVerts( &rmesa->radeon, n, size * 4 ) +#define ALLOC_VERTS( n, size ) r200_alloc_verts(rmesa, n, size) #define LOCAL_VARS \ r200ContextPtr rmesa = R200_CONTEXT(ctx); \ const char *r200verts = (char *)rmesa->radeon.swtcl.verts; |