diff options
author | Brian <[email protected]> | 2007-02-05 17:18:10 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-05 17:18:10 -0700 |
commit | 86080796471df6a9e126fd536b21c3b10cb5310c (patch) | |
tree | 26d7c96f3aa66061aacf5c9ca68f1a073b685f93 /src/mesa/shader/prog_print.c | |
parent | d9731b26e759671d63e357eee2c921e90448ada2 (diff) |
Use IR node's BranchNode field for IF/ELSE/ENDIF instructions.
This allows us to back-patch the IF/ELSE instruction's BranchTarget field
to point to the location of the ELSE/ENDIF instructions. No longer have to
search for ELSE/ENDIF in the interpreter. Also makes it trivial to translate
IF/ELSE instructions into conditional/unconditional BRA instructions.
Diffstat (limited to 'src/mesa/shader/prog_print.c')
-rw-r--r-- | src/mesa/shader/prog_print.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 208c998661c..aea11da0db5 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -319,13 +319,14 @@ _mesa_print_instruction(const struct prog_instruction *inst, GLint indent) print_comment(inst); break; case OPCODE_IF: - _mesa_printf("IF (%s%s)", + _mesa_printf("IF (%s%s) (if false, goto %d)", condcode_string(inst->DstReg.CondMask), - swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); + swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), + inst->BranchTarget); print_comment(inst); return indent + 3; case OPCODE_ELSE: - _mesa_printf("ELSE\n"); + _mesa_printf("ELSE (goto %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDIF: _mesa_printf("ENDIF\n"); |