From aede39efd86d200ffbace8fc012104e31f673973 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 17 Aug 2009 07:51:16 +0100 Subject: [PATCH] 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(-) 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; + } } } -- 2.30.2