aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/arbvertparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/arbvertparse.c')
-rw-r--r--src/mesa/shader/arbvertparse.c79
1 files changed, 25 insertions, 54 deletions
diff --git a/src/mesa/shader/arbvertparse.c b/src/mesa/shader/arbvertparse.c
index 1cc2384fb58..27bdaff1c2c 100644
--- a/src/mesa/shader/arbvertparse.c
+++ b/src/mesa/shader/arbvertparse.c
@@ -52,104 +52,75 @@
void _mesa_debug_vp_inst(GLint num, struct prog_instruction *vp)
{
GLint a;
- static const char *opcode_string[] = {
- "ABS",
- "ADD",
- "ARL",
- "DP3",
- "DP4",
- "DPH",
- "DST",
- "END", /* Placeholder */
- "EX2", /* ARB only */
- "EXP",
- "FLR", /* ARB */
- "FRC", /* ARB */
- "LG2", /* ARB only */
- "LIT",
- "LOG",
- "MAD",
- "MAX",
- "MIN",
- "MOV",
- "MUL",
- "POW", /* ARB only */
- "PRINT", /* Mesa only */
- "RCC",
- "RCP",
- "RSQ",
- "SGE",
- "SLT",
- "SUB",
- "SWZ", /* ARB only */
- "XPD" /* ARB only */
- };
-
- static const char *file_string[] = {
- "TEMP",
- "INPUT",
- "OUTPUT",
- "LOCAL",
- "ENV",
- "NAMED",
- "STATE",
- "WRITE_ONLY",
- "ADDR"
- };
-
static const char swz[] = "xyzw01??";
for (a=0; a<num; a++) {
- _mesa_printf("%s", opcode_string[vp[a].Opcode]);
+ _mesa_printf("%s", _mesa_opcode_string(vp[a].Opcode));
if (vp[a].DstReg.File != 0xf) {
if (vp[a].DstReg.WriteMask != 0xf)
- _mesa_printf(" %s[%d].%s%s%s%s ", file_string[vp[a].DstReg.File], vp[a].DstReg.Index,
+ _mesa_printf(" %s[%d].%s%s%s%s ",
+ _mesa_program_file_string(vp[a].DstReg.File),
+ vp[a].DstReg.Index,
GET_BIT(vp[a].DstReg.WriteMask, 0) ? "x" : "",
GET_BIT(vp[a].DstReg.WriteMask, 1) ? "y" : "",
GET_BIT(vp[a].DstReg.WriteMask, 2) ? "z" : "",
GET_BIT(vp[a].DstReg.WriteMask, 3) ? "w" : "");
else
- _mesa_printf(" %s[%d] ", file_string[vp[a].DstReg.File], vp[a].DstReg.Index);
+ _mesa_printf(" %s[%d] ",
+ _mesa_program_file_string(vp[a].DstReg.File),
+ vp[a].DstReg.Index);
}
if (vp[a].SrcReg[0].File != 0xf) {
if (vp[a].SrcReg[0].Swizzle != SWIZZLE_NOOP ||
vp[a].SrcReg[0].NegateBase)
- _mesa_printf("%s[%d].%s%c%c%c%c ", file_string[vp[a].SrcReg[0].File], vp[a].SrcReg[0].Index,
+ _mesa_printf("%s[%d].%s%c%c%c%c ",
+ _mesa_program_file_string(vp[a].SrcReg[0].File),
+ vp[a].SrcReg[0].Index,
vp[a].SrcReg[0].NegateBase ? "-" : "",
swz[GET_SWZ(vp[a].SrcReg[0].Swizzle, 0)],
swz[GET_SWZ(vp[a].SrcReg[0].Swizzle, 1)],
swz[GET_SWZ(vp[a].SrcReg[0].Swizzle, 2)],
swz[GET_SWZ(vp[a].SrcReg[0].Swizzle, 3)]);
else
- _mesa_printf("%s[%d] ", file_string[vp[a].SrcReg[0].File], vp[a].SrcReg[0].Index);
+ _mesa_printf("%s[%d] ",
+ _mesa_program_file_string(vp[a].SrcReg[0].File),
+ vp[a].SrcReg[0].Index);
}
if (vp[a].SrcReg[1].File != 0xf) {
if (vp[a].SrcReg[1].Swizzle != SWIZZLE_NOOP ||
vp[a].SrcReg[1].NegateBase)
- _mesa_printf("%s[%d].%s%c%c%c%c ", file_string[vp[a].SrcReg[1].File], vp[a].SrcReg[1].Index,
+ _mesa_printf("%s[%d].%s%c%c%c%c ",
+ _mesa_program_file_string(vp[a].SrcReg[1].File),
+ vp[a].SrcReg[1].Index,
vp[a].SrcReg[1].NegateBase ? "-" : "",
swz[GET_SWZ(vp[a].SrcReg[1].Swizzle, 0)],
swz[GET_SWZ(vp[a].SrcReg[1].Swizzle, 1)],
swz[GET_SWZ(vp[a].SrcReg[1].Swizzle, 2)],
swz[GET_SWZ(vp[a].SrcReg[1].Swizzle, 3)]);
else
- _mesa_printf("%s[%d] ", file_string[vp[a].SrcReg[1].File], vp[a].SrcReg[1].Index);
+ _mesa_printf("%s[%d] ",
+ _mesa_program_file_string(vp[a].SrcReg[1].File),
+ vp[a].SrcReg[1].Index);
}
if (vp[a].SrcReg[2].File != 0xf) {
if (vp[a].SrcReg[2].Swizzle != SWIZZLE_NOOP ||
vp[a].SrcReg[2].NegateBase)
- _mesa_printf("%s[%d].%s%c%c%c%c ", file_string[vp[a].SrcReg[2].File], vp[a].SrcReg[2].Index,
+ _mesa_printf("%s[%d].%s%c%c%c%c ",
+ _mesa_program_file_string(vp[a].SrcReg[2].File),
+ vp[a].SrcReg[2].Index,
vp[a].SrcReg[2].NegateBase ? "-" : "",
swz[GET_SWZ(vp[a].SrcReg[2].Swizzle, 0)],
swz[GET_SWZ(vp[a].SrcReg[2].Swizzle, 1)],
swz[GET_SWZ(vp[a].SrcReg[2].Swizzle, 2)],
swz[GET_SWZ(vp[a].SrcReg[2].Swizzle, 3)]);
else
- _mesa_printf("%s[%d] ", file_string[vp[a].SrcReg[2].File], vp[a].SrcReg[2].Index);
+ _mesa_printf("%s[%d] ",
+ _mesa_program_file_string(vp[a].SrcReg[2].File),
+ vp[a].SrcReg[2].Index);
}
_mesa_printf("\n");