diff options
author | Brian <[email protected]> | 2007-02-06 22:31:19 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-06 22:31:19 -0700 |
commit | f22ed0986a743e033d827c78371612c7115ff913 (patch) | |
tree | c9df47eeb7033ebdc2b5b596737bd14b24f41c9d /src/mesa/swrast | |
parent | 5f7d4668c4b7de1c0d2269809d30aef6d0a089e9 (diff) |
Implement CONT, improve BRK.
IR_LOOP's BranchNode ptr is the head of a linked list of CONT and BRK nodes.
After emitting loop, walk over the linked list, filling in the CONT/BRK
instruction's BranchTarget field (location of the ENDLOOP instruction, or
one past).
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 12c8aee6ea0..63974b30f20 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -704,6 +704,7 @@ execute_program( GLcontext *ctx, break; case OPCODE_BRK: /* break out of loop */ { +#if 0 /* The location of the ENDLOOP instruction is saved in the * BGNLOOP instruction. Get that instruction and jump to * its BranchTarget + 1. @@ -714,6 +715,9 @@ execute_program( GLcontext *ctx, ASSERT(loopBeginInst->BranchTarget >= 0); /* we'll add one at bottom of for-loop */ pc = loopBeginInst->BranchTarget; +#else + pc = inst->BranchTarget - 1; +#endif } break; case OPCODE_CAL: /* Call subroutine */ @@ -747,6 +751,8 @@ execute_program( GLcontext *ctx, } break; case OPCODE_CONT: /* continue loop */ + /* Subtract 1 here since we'll do pc++ at end of for-loop */ + pc = inst->BranchTarget - 1; break; case OPCODE_COS: { |