From: José Fonseca Date: Wed, 31 Oct 2007 14:16:00 +0000 (+0000) Subject: Allow more verbose error output. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af60ebc4eedcfec2090e1ddd7630137948c26866;p=mesa.git Allow more verbose error output. --- diff --git a/src/mesa/pipe/i915simple/i915_fpc.h b/src/mesa/pipe/i915simple/i915_fpc.h index c25f5abf0ea..8c7b68aefb5 100644 --- a/src/mesa/pipe/i915simple/i915_fpc.h +++ b/src/mesa/pipe/i915simple/i915_fpc.h @@ -204,7 +204,7 @@ extern void i915_disassemble_program(const uint * program, uint sz); */ extern void -i915_program_error(struct i915_fp_compile *p, const char *msg); +i915_program_error(struct i915_fp_compile *p, const char *msg, ...); extern void i915_translate_fragment_program(struct i915_context *i915); diff --git a/src/mesa/pipe/i915simple/i915_fpc_translate.c b/src/mesa/pipe/i915simple/i915_fpc_translate.c index e041f891401..7db7e4f6ba9 100644 --- a/src/mesa/pipe/i915simple/i915_fpc_translate.c +++ b/src/mesa/pipe/i915simple/i915_fpc_translate.c @@ -25,6 +25,9 @@ * **************************************************************************/ + +#include + #include "i915_reg.h" #include "i915_context.h" #include "i915_fpc.h" @@ -111,9 +114,16 @@ i915_use_passthrough_shader(struct i915_context *i915) void -i915_program_error(struct i915_fp_compile *p, const char *msg) +i915_program_error(struct i915_fp_compile *p, const char *msg, ...) { - fprintf(stderr, "i915_program_error: %s\n", msg); + va_list args; + + fprintf(stderr, "i915_program_error: "); + va_start( args, msg ); + vfprintf( stderr, msg, args ); + va_end( args ); + fprintf(stderr, "\n"); + p->error = 1; } @@ -855,7 +865,7 @@ i915_translate_instruction(struct i915_fp_compile *p, break; default: - i915_program_error(p, "bad opcode"); + i915_program_error(p, "bad opcode %d", inst->Instruction.Opcode); return; }