summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-03-10 16:36:20 -0500
committerZack Rusin <[email protected]>2010-03-10 16:56:42 -0500
commitac33e7752d22f03db84e6a4c822b3a3f41d05f77 (patch)
tree34c5b6d53113199e9b5c0ded841c883e45887610 /src/gallium/auxiliary/gallivm
parent18d406e8a8a838c82ee4ec5dbf244ab8bba0855e (diff)
gallivm: properly test the if condition and branch to the proper label
makes loops work
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 085afe33deb..aa57289395e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -301,7 +301,7 @@ static void lp_exec_endloop(struct lp_exec_mask *mask)
endloop = lp_build_insert_new_block(mask->bld->builder, "endloop");
LLVMBuildCondBr(mask->bld->builder,
- i1cond, endloop, mask->loop_block);
+ i1cond, mask->loop_block, endloop);
LLVMPositionBuilderAtEnd(mask->bld->builder, endloop);
@@ -1498,6 +1498,8 @@ emit_instruction(
case TGSI_OPCODE_IF:
tmp0 = emit_fetch(bld, inst, 0, CHAN_X);
+ tmp0 = lp_build_cmp(&bld->base, PIPE_FUNC_NOTEQUAL,
+ tmp0, bld->base.zero);
lp_exec_mask_cond_push(&bld->exec_mask, tmp0);
break;