summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_sample.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-09-30 16:43:56 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-10-06 18:49:32 +0100
commit5849a6ab6412eddd4552329178e6edb0bea92977 (patch)
tree69d4d1899dc25b750fd6a9bc93311451af27f01a /src/gallium/auxiliary/gallivm/lp_bld_sample.c
parentaf05f6157668b3c5e6fd73c3d743b11e619b9067 (diff)
gallivm: don't apply zero lod_bias
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index acd99741f1..2227a062d0 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -132,6 +132,10 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
state->min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
}
+ if (sampler->lod_bias != 0.0) {
+ state->lod_bias_non_zero = 1;
+ }
+
/* If min_lod == max_lod we can greatly simplify mipmap selection.
* This is a case that occurs during automatic mipmap generation.
*/
@@ -258,7 +262,8 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
}
/* add sampler lod bias */
- lod = LLVMBuildFAdd(bld->builder, lod, sampler_lod_bias, "sampler_lod_bias");
+ if (bld->static_state->lod_bias_non_zero)
+ lod = LLVMBuildFAdd(bld->builder, lod, sampler_lod_bias, "sampler_lod_bias");
/* clamp lod */
lod = lp_build_clamp(float_bld, lod, min_lod, max_lod);