Re: [Mesa-dev] [PATCH] gallivm: fix returning unconditionally from main on TGSI_OPCODE_RET
Ok forget about this it still doesn't work correctly. Need to figure out how all the mask business fits together. Roland Am 15.03.2013 19:34, schrieb srol...@vmware.com: > From: Roland Scheidegger > > If we're in some conditional we must not return, or the code after > the condition is never executed. > (Probably the same for loops.) > This fixes https://bugs.freedesktop.org/show_bug.cgi?id=62357. > > Note: This is a candidate for the stable branches. > --- > src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c > b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c > index 0dc26b5..b5f0ace 100644 > --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c > +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c > @@ -348,7 +348,9 @@ static void lp_exec_mask_ret(struct lp_exec_mask *mask, > int *pc) > LLVMBuilderRef builder = mask->bld->gallivm->builder; > LLVMValueRef exec_mask; > > - if (mask->call_stack_size == 0) { > + if (mask->call_stack_size == 0 && > + mask->cond_stack_size == 0 && > + mask->loop_stack_size == 0) { >/* returning from main() */ >*pc = -1; >return; > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallivm: fix returning unconditionally from main on TGSI_OPCODE_RET
On 03/15/2013 12:34 PM, srol...@vmware.com wrote: From: Roland Scheidegger If we're in some conditional we must not return, or the code after the condition is never executed. (Probably the same for loops.) This fixes https://bugs.freedesktop.org/show_bug.cgi?id=62357. Note: This is a candidate for the stable branches. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 0dc26b5..b5f0ace 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -348,7 +348,9 @@ static void lp_exec_mask_ret(struct lp_exec_mask *mask, int *pc) LLVMBuilderRef builder = mask->bld->gallivm->builder; LLVMValueRef exec_mask; - if (mask->call_stack_size == 0) { + if (mask->call_stack_size == 0&& + mask->cond_stack_size == 0&& + mask->loop_stack_size == 0) { /* returning from main() */ *pc = -1; return; Reviewed-by: Brian Paul ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev