mesa: better handling/printing of driver-specific opcodes, register files

Drivers such as i965 define extra instruction opcodes and register files.
Improve the program printing code to handle those opcodes/files better.
This commit is contained in:
Brian Paul
2009-05-11 09:38:32 -06:00
parent 53c2cc8fef
commit 7c2fe42ded
2 changed files with 14 additions and 4 deletions
+5 -2
View File
@@ -343,7 +343,10 @@ _mesa_opcode_string(gl_inst_opcode opcode)
{
if (opcode < MAX_OPCODE)
return InstInfo[opcode].Name;
else
return "OP?";
else {
static char s[20];
_mesa_snprintf(s, sizeof(s), "OP%u", opcode);
return s;
}
}
+9 -2
View File
@@ -75,7 +75,11 @@ file_string(gl_register_file f, gl_prog_print_mode mode)
case PROGRAM_UNDEFINED:
return "UNDEFINED";
default:
return "Unknown program file!";
{
static char s[20];
_mesa_snprintf(s, sizeof(s), "FILE%u", f);
return s;
}
}
}
@@ -736,7 +740,10 @@ _mesa_fprint_instruction_opt(FILE *f,
mode, prog);
}
else {
_mesa_fprintf(f, "Other opcode %d\n", inst->Opcode);
fprint_alu_instruction(f, inst,
_mesa_opcode_string(inst->Opcode),
3/*_mesa_num_inst_src_regs(inst->Opcode)*/,
mode, prog);
}
break;
}