aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2008-05-19 21:11:55 +1000
committerDave Airlie <[email protected]>2008-05-19 21:11:55 +1000
commit60b8e1f5243dfc3233d38700755a06c38b4967f1 (patch)
tree27cd08ce81d83b2a04046aba77e5e32dd97eba23 /src
parentcddab021e392ed78b5375ef6924bc7d4dbdd01c0 (diff)
r500: add mask debugging
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c27
1 files changed, 26 insertions, 1 deletions
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: