diff options
author | Pauli Nieminen <suokkos@gmail.com> | 2009-09-10 16:41:59 +0300 |
---|---|---|
committer | Pauli Nieminen <suokkos@gmail.com> | 2009-09-10 16:53:08 +0300 |
commit | 3d1324a66a3b8927a400d167ba92f851b464c57a (patch) | |
tree | 5ae577a8900795f23021be6fa409d510f6a0f56c /src/mesa/drivers/dri/radeon/radeon_debug.c | |
parent | 2b692cd6d6f42d4e7a7f8100383759d49a907f1d (diff) |
radeon: Change debugging code to use macros instead of inline functions.
Variadic functions can't be inlined which makes debugging to have quite large
function overead. Only aleternative method is to use variadic macros which are
inlined so compiler can optimize debugging to minimize overhead.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_debug.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_debug.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c index a1ed39683f..3b6f003803 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.c +++ b/src/mesa/drivers/dri/radeon/radeon_debug.c @@ -32,6 +32,9 @@ #include "radeon_debug.h" #include "radeon_common_context.h" +#include <stdarg.h> +#include <stdio.h> + static const struct dri_debug_control debug_control[] = { {"fall", RADEON_FALLBACKS}, {"tex", RADEON_TEXTURE}, @@ -85,10 +88,10 @@ void _radeon_debug_remove_indent(void) } } -extern void _radeon_print(const radeon_debug_type_t type, +void _radeon_print(const radeon_debug_type_t type, const radeon_debug_level_t level, const char* message, - va_list values) + ...) { GET_CURRENT_CONTEXT(ctx); if (ctx) { @@ -97,5 +100,8 @@ extern 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 ); } |