diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2007-03-18 13:09:21 +0100 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2007-03-19 18:38:07 +0100 |
commit | ec1a77c86481d7f77542fbecda0e81b74732c90f (patch) | |
tree | 370321747cf245290fd8ee699bb1e8095e0d5c94 | |
parent | a8e65a010c17444c63859c17786ecb4010bd49c1 (diff) |
r300: Fragment program dumps format tex instructions
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_fragprog.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index c3d902a4aa..3c54830312 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -2230,8 +2230,34 @@ static void dump_program(struct r300_fragment_program *rp) if (rp->tex.length) { fprintf(stderr, " TEX:\n"); - for(i = rp->node[n].tex_offset; i <= rp->node[n].tex_offset+rp->node[n].tex_end; ++i) - fprintf(stderr, " %08x\n", rp->tex.inst[i]); + for(i = rp->node[n].tex_offset; i <= rp->node[n].tex_offset+rp->node[n].tex_end; ++i) { + const char* instr; + + switch((rp->tex.inst[i] >> R300_FPITX_OPCODE_SHIFT) & 15) { + case R300_FPITX_OP_TEX: + instr = "TEX"; + break; + case R300_FPITX_OP_KIL: + instr = "KIL"; + break; + case R300_FPITX_OP_TXP: + instr = "TXP"; + break; + case R300_FPITX_OP_TXB: + instr = "TXB"; + break; + default: + instr = "UNKNOWN"; + } + + fprintf(stderr, " %s t%i, %c%i, texture[%i] (%08x)\n", + instr, + (rp->tex.inst[i] >> R300_FPITX_DST_SHIFT) & 31, + (rp->tex.inst[i] & R300_FPITX_SRC_CONST) ? 'c': 't', + (rp->tex.inst[i] >> R300_FPITX_SRC_SHIFT) & 31, + (rp->tex.inst[i] & R300_FPITX_IMAGE_MASK) >> R300_FPITX_IMAGE_SHIFT, + rp->tex.inst[i]); + } } for(i = rp->node[n].alu_offset; i <= rp->node[n].alu_offset+rp->node[n].alu_end; ++i) { |