summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJames Benton <[email protected]>2012-07-17 12:08:02 +0100
committerJosé Fonseca <[email protected]>2012-07-17 13:16:38 +0100
commite253175c9c8034bfc13ecc3e16ab72007bde744a (patch)
tree66b8d065d14682d2d1a55baa53ce28edcb0d7f81 /src/gallium
parent89e755d7621a15fbf8ad32e6c7b82d4d0ff5b993 (diff)
llvmpipe: Fix bug with blend factor in complementary optimisations.
Fixes fdo 52168. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_blend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.c b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
index a87a220ea48..75309dd5fcd 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
@@ -152,20 +152,22 @@ lp_build_blend(struct lp_build_context *bld,
}
} else if(bld->type.floating && func == PIPE_BLEND_SUBTRACT) {
result = lp_build_add(bld, src, dst);
- result = lp_build_mul(bld, result, src_factor);
if (factor_src < factor_dst) {
+ result = lp_build_mul(bld, result, src_factor);
return lp_build_sub(bld, result, dst);
} else {
+ result = lp_build_mul(bld, result, dst_factor);
return lp_build_sub(bld, src, result);
}
} else if(bld->type.floating && func == PIPE_BLEND_REVERSE_SUBTRACT) {
result = lp_build_add(bld, src, dst);
- result = lp_build_mul(bld, result, src_factor);
if (factor_src < factor_dst) {
+ result = lp_build_mul(bld, result, src_factor);
return lp_build_sub(bld, dst, result);
} else {
+ result = lp_build_mul(bld, result, dst_factor);
return lp_build_sub(bld, result, src);
}
}