diff options
author | Brian Paul <[email protected]> | 2009-03-05 17:14:05 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-03-05 17:25:25 -0700 |
commit | f787baff80235e8f90a72d43d4372b1ac977f161 (patch) | |
tree | 316423b70754b747a3a1c765e8c2ddfe74cdb19a | |
parent | ee41bb2ed01b9480e5370d67257334b81ec0c90e (diff) |
mesa: when printing src regs, use |reg| for absolute value
And check opcode number to avoid crashing on driver-private opcodes.
-rw-r--r-- | src/mesa/shader/prog_print.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 2747480834e..6988e9c052e 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -458,11 +458,15 @@ fprint_src_reg(FILE *f, gl_prog_print_mode mode, const struct gl_program *prog) { - _mesa_fprintf(f, "%s%s", + const char *abs = srcReg->Abs ? "|" : ""; + + _mesa_fprintf(f, "%s%s%s%s", + abs, reg_string((enum register_file) srcReg->File, srcReg->Index, mode, srcReg->RelAddr, prog), _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); + srcReg->NegateBase, GL_FALSE), + abs); #if 0 _mesa_fprintf(f, "%s[%d]%s", file_string((enum register_file) srcReg->File, mode), @@ -724,11 +728,16 @@ _mesa_fprint_instruction_opt(FILE *f, break; /* XXX may need other special-case instructions */ default: - /* typical alu instruction */ - fprint_alu_instruction(f, inst, - _mesa_opcode_string(inst->Opcode), - _mesa_num_inst_src_regs(inst->Opcode), - mode, prog); + if (inst->Opcode < MAX_OPCODE) { + /* typical alu instruction */ + fprint_alu_instruction(f, inst, + _mesa_opcode_string(inst->Opcode), + _mesa_num_inst_src_regs(inst->Opcode), + mode, prog); + } + else { + _mesa_fprintf(f, "Other opcode %d\n", inst->Opcode); + } break; } return indent; |