From: Brian Paul Date: Mon, 2 Jan 2012 18:55:40 +0000 (-0700) Subject: radeon: move declarations before code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01a63f4bf5ab5e2e67982c6c60670dd2b4fe9fcb;p=mesa.git radeon: move declarations before code --- diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c index 413000b6c06..dd0afb809a0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.c +++ b/src/mesa/drivers/dri/radeon/radeon_debug.c @@ -93,6 +93,8 @@ void _radeon_print(const radeon_debug_type_t type, const char* message, ...) { + va_list values; + GET_CURRENT_CONTEXT(ctx); if (ctx) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); @@ -100,7 +102,6 @@ void _radeon_print(const radeon_debug_type_t type, if (radeon->debug.indent_depth) fprintf(stderr, "%s", radeon->debug.indent); } - va_list values; va_start( values, message ); vfprintf(stderr, message, values); va_end( values ); diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 874ba926dc4..06cb8075da1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -401,8 +401,6 @@ static GLuint radeonEnsureEmitSize( struct gl_context * ctx , GLuint inputs ) /* predict size for elements */ for (i = 0; i < VB->PrimitiveCount; ++i) { - if (!VB->Primitive[i].count) - continue; /* If primitive.count is less than MAX_CONVERSION_SIZE rendering code may decide convert to elts. In that case we have to make pessimistic prediction. @@ -410,6 +408,8 @@ static GLuint radeonEnsureEmitSize( struct gl_context * ctx , GLuint inputs ) const GLuint elts = ELTS_BUFSZ(nr_aos); const GLuint index = INDEX_BUFSZ; const GLuint vbuf = VBUF_BUFSZ; + if (!VB->Primitive[i].count) + continue; if ( (!VB->Elts && VB->Primitive[i].count >= MAX_CONVERSION_SIZE) || vbuf > index + elts) space_required += vbuf; @@ -442,6 +442,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx, struct vertex_buffer *VB = &tnl->vb; GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0; GLuint i; + GLuint emit_end; /* TODO: separate this from the swtnl pipeline */ @@ -477,7 +478,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx, } radeonReleaseArrays( ctx, ~0 ); - GLuint emit_end = radeonEnsureEmitSize( ctx, inputs ) + emit_end = radeonEnsureEmitSize( ctx, inputs ) + rmesa->radeon.cmdbuf.cs->cdw; radeonEmitArrays( ctx, inputs );