Allow more verbose error output.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Wed, 31 Oct 2007 14:16:00 +0000 (14:16 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Wed, 31 Oct 2007 14:16:00 +0000 (14:16 +0000)
src/mesa/pipe/i915simple/i915_fpc.h
src/mesa/pipe/i915simple/i915_fpc_translate.c

index c25f5ab..8c7b68a 100644 (file)
@@ -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);
index e041f89..7db7e4f 100644 (file)
@@ -25,6 +25,9 @@
  * 
  **************************************************************************/
 
+
+#include <stdarg.h>
+
 #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;
    }