OSDN Git Service

restore debug output after brw_wm_fp compilation stage
authorKeith Whitwell <keith@tungstengraphics.com>
Wed, 20 Sep 2006 12:53:35 +0000 (12:53 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 20 Sep 2006 12:53:35 +0000 (12:53 +0000)
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_fp.c

index 74c3bbe..ec6ad61 100644 (file)
@@ -167,6 +167,7 @@ struct brw_wm_instruction {
 #define WM_CINTERP        (MAX_OPCODE + 5)
 #define WM_WPOSXY         (MAX_OPCODE + 6)
 #define WM_FB_WRITE       (MAX_OPCODE + 7)
+#define MAX_WM_OPCODE     (MAX_OPCODE + 8)
 
 #define PROGRAM_PAYLOAD   (PROGRAM_FILE_MAX)
 #define PAYLOAD_DEPTH     (FRAG_ATTRIB_MAX)
index 203eeea..2f59684 100644 (file)
@@ -769,6 +769,27 @@ static void validate_src_regs( struct brw_wm_compile *c,
         
 
 
+static void print_insns( const struct prog_instruction *insn,
+                        GLuint nr )
+{
+   GLuint i;
+   for (i = 0; i < nr; i++, insn++) {
+      _mesa_printf("%3d: ", i);
+      if (insn->Opcode < MAX_OPCODE)
+        _mesa_print_instruction(insn);
+      else if (insn->Opcode < MAX_WM_OPCODE) {
+        GLuint idx = insn->Opcode - MAX_OPCODE;
+
+        _mesa_print_alu_instruction(insn,
+                                    wm_opcode_strings[idx],
+                                    3);
+      }
+      else 
+        _mesa_printf("UNKNOWN\n");
+          
+   }
+}
+
 void brw_wm_pass_fp( struct brw_wm_compile *c )
 {
    struct brw_fragment_program *fp = c->fp;
@@ -867,7 +888,7 @@ void brw_wm_pass_fp( struct brw_wm_compile *c )
 
    if (INTEL_DEBUG & DEBUG_WM) {
       _mesa_printf("\n\n\npass_fp:\n");
-/*       _mesa_debug_fp_inst(c->nr_fp_insns, c->prog_instructions, wm_opcode_strings, wm_file_strings);  */
+      print_insns( c->prog_instructions, c->nr_fp_insns );
       _mesa_printf("\n");
    }
 }