added _mesa_program_file_string()
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 5 Nov 2005 19:32:36 +0000 (19:32 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 5 Nov 2005 19:32:36 +0000 (19:32 +0000)
src/mesa/shader/program.c
src/mesa/shader/program_instruction.h

index 45d99c974659fd5d9b259d348ab174f648a96aef..44949500d616d093fbd23a5390adc69bed58f9f3 100644 (file)
@@ -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                                                      */
index 07a22145faabe2a7628e1ff189016b8f5deea023..dbec622634c43ba22c1c34a904b8d1a418b32d17 100644 (file)
@@ -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 */