diff options
author | Brian Paul <[email protected]> | 2009-02-17 15:57:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-02-17 16:17:13 -0700 |
commit | f88a9015985f1e308496803630221f284a94f397 (patch) | |
tree | 494412f3c14fa247376dfb110a3014c74921bcca | |
parent | fd51cf1531f1630ee1cb154b3b7fefad9ed820f1 (diff) |
mesa: when printing/dumping instruction, include relative addressing info
Not all cases were handled before.
-rw-r--r-- | src/mesa/shader/prog_print.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index ce48767a871..516ea733017 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -212,15 +212,13 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, GLboolean relAddr, const struct gl_program *prog) { static char str[100]; + const char *addr = relAddr ? "ADDR+" : ""; str[0] = 0; switch (mode) { case PROG_PRINT_DEBUG: - if (relAddr) - _mesa_sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index); - else - _mesa_sprintf(str, "%s[%d]", file_string(f, mode), index); + _mesa_sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); break; case PROG_PRINT_ARB: @@ -235,19 +233,19 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, _mesa_sprintf(str, "temp%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "program.env[%d]", index); + _mesa_sprintf(str, "program.env[%s%d]", addr, index); break; case PROGRAM_LOCAL_PARAM: - _mesa_sprintf(str, "program.local[%d]", index); + _mesa_sprintf(str, "program.local[%s%d]", addr, index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: { @@ -284,16 +282,16 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, _mesa_sprintf(str, "c[%d]", index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: /* extension */ - _mesa_sprintf(str, "state[%d]", index); + _mesa_sprintf(str, "state[%s%d]", addr, index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); |