From: José Fonseca Date: Sun, 9 Aug 2009 21:59:52 +0000 (+0100) Subject: llvmpipe: Handle disabled blending too. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7fc21434d2c5a9177a427950be5029ff4db43ee;p=mesa.git llvmpipe: Handle disabled blending too. --- diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c index e4a57af94c7..a9ea2f4986d 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c @@ -302,6 +302,9 @@ lp_build_blend_aos(LLVMBuilderRef builder, LLVMValueRef src_term; LLVMValueRef dst_term; + if(!blend->blend_enable) + return src; + /* It makes no sense to blend unless values are normalized */ assert(type.norm); diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c index 1ef1718cfda..44c5a516e43 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c @@ -167,6 +167,15 @@ lp_build_blend_soa(LLVMBuilderRef builder, struct lp_build_blend_soa_context bld; unsigned i, j; + if(!blend->blend_enable) { + for (i = 0; i < 4; ++i) + res[i] = src[i]; + return; + } + + /* It makes no sense to blend unless values are normalized */ + assert(type.norm); + /* Setup build context */ memset(&bld, 0, sizeof bld); lp_build_context_init(&bld.base, builder, type); diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c index 8bf5508bd4e..5a09df5306f 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c @@ -766,7 +766,7 @@ blend_funcs[] = { const union lp_type blend_types[] = { /* float, fixed, sign, norm, width, len */ - {{ TRUE, FALSE, TRUE, TRUE, 32, 4 }}, /* f32 x 4 */ + {{ TRUE, FALSE, FALSE, TRUE, 32, 4 }}, /* f32 x 4 */ {{ FALSE, FALSE, FALSE, TRUE, 8, 16 }}, /* u8n x 16 */ };