Mesa (master): radeon: move declarations before code
Brian Paul
brianp at kemper.freedesktop.org
Mon Jan 2 18:58:59 UTC 2012
Module: Mesa
Branch: master
Commit: 01a63f4bf5ab5e2e67982c6c60670dd2b4fe9fcb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01a63f4bf5ab5e2e67982c6c60670dd2b4fe9fcb
Author: Brian Paul <brianp at vmware.com>
Date: Mon Jan 2 11:55:40 2012 -0700
radeon: move declarations before code
---
src/mesa/drivers/dri/radeon/radeon_debug.c | 3 ++-
src/mesa/drivers/dri/radeon/radeon_tcl.c | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c
index 413000b..dd0afb8 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 874ba92..06cb807 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 );
More information about the mesa-commit
mailing list