summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-11-05 19:32:36 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-11-05 19:32:36 +0000
commitbf41bc03c2b461e246658704ba0b38474312cac5 (patch)
tree86045c5b2481fcb24a038d04a7daa6b11863f7d9 /src/mesa
parentb7c87974b38dbe68c52e729f0692f3e4875c097c (diff)
added _mesa_program_file_string()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/program.c32
-rw-r--r--src/mesa/shader/program_instruction.h2
2 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 45d99c9746..44949500d6 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -1071,6 +1071,38 @@ _mesa_opcode_string(enum prog_opcode opcode)
return InstInfo[opcode].Name;
}
+/**
+ * Return string name for given program/register file.
+ */
+const char *
+_mesa_program_file_string(enum register_file f)
+{
+ switch (f) {
+ case PROGRAM_TEMPORARY:
+ return "TEMP";
+ case PROGRAM_LOCAL_PARAM:
+ return "LOCAL";
+ case PROGRAM_ENV_PARAM:
+ return "ENV";
+ case PROGRAM_STATE_VAR:
+ return "STATE";
+ case PROGRAM_INPUT:
+ return "INPUT";
+ case PROGRAM_OUTPUT:
+ return "OUTPUT";
+ case PROGRAM_NAMED_PARAM:
+ return "NAMED";
+ case PROGRAM_CONSTANT:
+ return "CONST";
+ case PROGRAM_WRITE_ONLY:
+ return "WRITE_ONLY";
+ case PROGRAM_ADDRESS:
+ return "ADDR";
+ default:
+ return "!unkown!";
+ }
+}
+
/**********************************************************************/
/* API functions */
diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h
index 07a22145fa..dbec622634 100644
--- a/src/mesa/shader/program_instruction.h
+++ b/src/mesa/shader/program_instruction.h
@@ -346,5 +346,7 @@ _mesa_num_inst_src_regs(enum prog_opcode opcode);
extern const char *
_mesa_opcode_string(enum prog_opcode opcode);
+extern const char *
+_mesa_program_file_string(enum register_file f);
#endif /* PROG_INSTRUCTION_H */