_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 */
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;