summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-22 14:15:30 -0700
committerBrian Paul <[email protected]>2009-12-22 14:26:06 -0700
commitdb721151b76611b75bcedfc90221ef5f92e8edeb (patch)
treef7b8f781859d436ac23eef8e5e672b3345e9ef0f /src/mesa/shader/slang
parente8ea2d26cd9e90d45cdfb94c3a6b06e27d6c0083 (diff)
mesa: adjust BRK/CONT BranchTarget to always point to ENDLOOP instruction
To be more consistant.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_emit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 99eb254cee0..e769d0d3ad4 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1814,7 +1814,7 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n)
/* Done emitting loop code. Now walk over the loop's linked list of
* BREAK and CONT nodes, filling in their BranchTarget fields (which
- * will point to the ENDLOOP+1 or BGNLOOP instructions, respectively).
+ * will point to the corresponding ENDLOOP instruction.
*/
for (ir = n->List; ir; ir = ir->List) {
struct prog_instruction *inst = prog->Instructions + ir->InstLocation;
@@ -1823,8 +1823,8 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n)
ir->Opcode == IR_BREAK_IF_TRUE) {
assert(inst->Opcode == OPCODE_BRK ||
inst->Opcode == OPCODE_BRA);
- /* go to instruction after end of loop */
- inst->BranchTarget = endInstLoc + 1;
+ /* go to instruction at end of loop */
+ inst->BranchTarget = endInstLoc;
}
else {
assert(ir->Opcode == IR_CONT ||