diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-05-08 23:16:38 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-05-08 23:29:05 +0100 |
commit | 08b3179f483c9dacc9a0a46118afff6077eb0e8b (patch) | |
tree | aef58caf21851959537ce8559e5dc99d88ce24a4 /src/gallium/auxiliary | |
parent | ff7542ab90154769930c80d58597cfec40844bd9 (diff) |
gallivm: Fix mipfiltering with negative lod bias.
In particular, don't use the clamped lod to compute level + 1, or
lod in [-1, 0] range will actually interpolate with level 1.
This makes Mipfilter DCT pass 100%.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index dd0053f212..3b1e6df4ec 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -1046,8 +1046,10 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld, int_bld->zero, last_level); /* compute level 1 and clamp to legal range of levels */ - *level1_out = lp_build_add(int_bld, *level0_out, int_bld->one); - *level1_out = lp_build_min(int_bld, *level1_out, last_level); + level = lp_build_add(int_bld, level, int_bld->one); + *level1_out = lp_build_clamp(int_bld, level, + int_bld->zero, + last_level); *weight_out = lp_build_fract(float_bld, lod); } |