From: Brian Paul Date: Sat, 5 Nov 2005 19:32:36 +0000 (+0000) Subject: added _mesa_program_file_string() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf41bc03c2b461e246658704ba0b38474312cac5;p=mesa.git added _mesa_program_file_string() --- diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 45d99c97465..44949500d61 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 07a22145faa..dbec622634c 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 */