From 60b8e1f5243dfc3233d38700755a06c38b4967f1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 19 May 2008 21:11:55 +1000 Subject: [PATCH] r500: add mask debugging --- src/mesa/drivers/dri/r300/r500_fragprog.c | 27 ++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index 252171c66bf..d0675f6eb3a 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -1059,6 +1059,30 @@ static char *to_alpha_op(int op_val) return str; } +static char *to_mask(int val) +{ + char *str; + switch(val) { + case 0: str = "NONE"; break; + case 1: str = "R"; break; + case 2: str = "G"; break; + case 3: str = "RG"; break; + case 4: str = "B"; break; + case 5: str = "RB"; break; + case 6: str = "GB"; break; + case 7: str = "RGB"; break; + case 8: str = "A"; break; + case 9: str = "AR"; break; + case 10: str = "AG"; break; + case 11: str = "ARG"; break; + case 12: str = "AB"; break; + case 13: str = "ARB"; break; + case 14: str = "AGB"; break; + case 15: str = "ARGB"; break; + } + return str; +} + static void dump_program(struct r500_fragment_program *fp) { int pc = 0; @@ -1081,7 +1105,8 @@ static void dump_program(struct r500_fragment_program *fp) inst & R500_INST_LAST ? "LAST" : "", inst & R500_INST_NOP ? "NOP" : "", inst & R500_INST_ALU_WAIT ? "ALU WAIT" : ""); - fprintf(stderr,"%x %x\n", (inst >> 11) & 0xf, (inst >> 15) & 0xf); + fprintf(stderr,"wmask: %s omask: %s\n", to_mask((inst >> 11) & 0xf), + to_mask((inst >> 15) & 0xf)); switch(inst0 & 0x3) { case 0: -- 2.30.2