summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-16 13:50:31 -0700
committerBrian <[email protected]>2008-02-16 13:50:31 -0700
commit3b2a291888d8e62787de03f8529806fb562bd186 (patch)
treecd263a55a574d8109a026161283d9ba2543314eb
parent08c9534107fcaf06f9b801551524ed5dc724db13 (diff)
gallium: tweak texture filter min/mag thresholds
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index c0128f81d71..a15bd43166d 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -474,7 +474,6 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
{
if (sampler->state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
/* no mipmap selection needed */
- *imgFilter = sampler->state->mag_img_filter;
*level0 = *level1 = (int) sampler->state->min_lod;
if (sampler->state->min_img_filter != sampler->state->mag_img_filter) {
@@ -482,13 +481,16 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
* minification or magnification.
*/
float lambda = compute_lambda(sampler, s, t, p, lodbias);
- if (lambda < 0.5) { /* XXX this may need tweaking... */
+ if (lambda <= 0.0) {
*imgFilter = sampler->state->mag_img_filter;
}
else {
*imgFilter = sampler->state->min_img_filter;
}
}
+ else {
+ *imgFilter = sampler->state->mag_img_filter;
+ }
}
else {
float lambda;
@@ -500,7 +502,7 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
/* vertex shader */
lambda = lodbias; /* not really a bias, but absolute LOD */
- if (lambda < 0.0) { /* XXX threshold depends on the filter */
+ if (lambda <= 0.0) { /* XXX threshold depends on the filter */
/* magnifying */
*imgFilter = sampler->state->mag_img_filter;
*level0 = *level1 = 0;