diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/program.c | 32 | ||||
-rw-r--r-- | src/mesa/shader/program_instruction.h | 2 |
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 */ |