[Mesa-dev] [PATCH] gallivm: fix returning unconditionally from main on TGSI_OPCODE_RET
Roland Scheidegger
sroland at vmware.com
Fri Mar 15 12:38:01 PDT 2013
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 sroland at vmware.com:
> From: Roland Scheidegger <sroland at vmware.com>
>
> 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;
>
More information about the mesa-dev
mailing list