summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-27 14:53:17 -0600
committerBrian <[email protected]>2007-03-27 16:06:47 -0600
commitf407cada8aa0bfea1b8dfae766392162c702aaa4 (patch)
tree45cc6427169167781c0d38b4b17a3c2cd12584f9 /src/mesa
parente713ef66ef759d902c08a8cb8eb0e0cfe9373699 (diff)
fix some printing issues related to subroutines
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/prog_print.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 8fa7ef3d824..4ecdc82d156 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -567,17 +567,6 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
_mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
print_comment(inst);
break;
- case OPCODE_CAL:
- _mesa_printf("CAL %u", inst->BranchTarget);
- print_comment(inst);
- break;
- case OPCODE_RET:
- _mesa_printf("RET (%s%s); # (goto %d)",
- condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
- inst->BranchTarget);
- print_comment(inst);
- break;
case OPCODE_IF:
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
/* Use ordinary register */
@@ -629,13 +618,38 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
break;
case OPCODE_BGNSUB:
- _mesa_printf("BGNSUB");
- print_comment(inst);
- return indent + 3;
+ if (mode == PROG_PRINT_NV) {
+ _mesa_printf("%s:\n", inst->Comment); /* comment is label */
+ return indent;
+ }
+ else {
+ _mesa_printf("BGNSUB");
+ print_comment(inst);
+ return indent + 3;
+ }
case OPCODE_ENDSUB:
- _mesa_printf("ENDSUB");
+ if (mode == PROG_PRINT_DEBUG) {
+ _mesa_printf("ENDSUB");
+ print_comment(inst);
+ }
+ break;
+ case OPCODE_CAL:
+ if (mode == PROG_PRINT_NV) {
+ _mesa_printf("CAL %s;\n", inst->Comment);
+ }
+ else {
+ _mesa_printf("CAL %u", inst->BranchTarget);
+ print_comment(inst);
+ }
+ break;
+ case OPCODE_RET:
+ _mesa_printf("RET (%s%s); # (goto %d)",
+ condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
+ inst->BranchTarget);
print_comment(inst);
break;
+
case OPCODE_END:
_mesa_printf("END\n");
break;