From aede39efd86d200ffbace8fc012104e31f673973 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 17 Aug 2009 07:51:16 +0100 Subject: llvmpipe: Fix translation of KIL with repeated swizzles. --- src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index 4ec1b9dbd85..7ef01c04514 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -386,14 +386,16 @@ emit_kil( } FOR_EACH_CHANNEL( chan_index ) { - LLVMValueRef mask; + if(terms[chan_index]) { + LLVMValueRef mask; - mask = lp_build_cmp(&bld->base, PIPE_FUNC_GEQUAL, terms[chan_index], bld->base.zero); - - if(bld->mask) - bld->mask = LLVMBuildAnd(bld->base.builder, bld->mask, mask, ""); - else - bld->mask = mask; + mask = lp_build_cmp(&bld->base, PIPE_FUNC_GEQUAL, terms[chan_index], bld->base.zero); + + if(bld->mask) + bld->mask = LLVMBuildAnd(bld->base.builder, bld->mask, mask, ""); + else + bld->mask = mask; + } } } -- cgit v1.2.3