summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2012-05-18 01:03:13 +0100
committerJosé Fonseca <[email protected]>2012-05-18 01:03:13 +0100
commit3f7a5ffac7e78bca47fa58849f5666fb334b3ab1 (patch)
treedf7663c4867705eeeaffb1ee3a813e16b2a9ac54 /src
parent00eb74b275e21d567a0ab8a6731181e005208634 (diff)
llvmpipe: Avoid adding floating point zero to flat inputs.
Which could clobber integer inputs, if the addition is not optimized away (e.g., if optimizations are disabled for debugging purposes).
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
index 0608ab0a2a7..0d51ccb0349 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
@@ -239,7 +239,10 @@ coeffs_init(struct lp_build_interp_soa_context *bld,
* Compute the attrib values on the upper-left corner of each quad.
*/
- a = LLVMBuildFAdd(builder, a, dadq2, "");
+ if (interp != LP_INTERP_CONSTANT &&
+ interp != LP_INTERP_FACING) {
+ a = LLVMBuildFAdd(builder, a, dadq2, "");
+ }
#if PERSPECTIVE_DIVIDE_PER_QUAD
/*