summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-16 10:05:01 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-16 10:05:24 -0700
commit08c9534107fcaf06f9b801551524ed5dc724db13 (patch)
treee651c47a08e081b537392edd0ffc3c55ed7d40b0
parentf9973b1c3d6b1759add1fe7af425231393a1ca33 (diff)
gallium: implement min vs. mag filter determination for non-mipmapped textures
Fixes tests/minmag.c
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 2f82fd6abea..c0128f81d71 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -476,6 +476,19 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
/* 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) {
+ /* non-mipmapped texture, but still need to determine if doing
+ * minification or magnification.
+ */
+ float lambda = compute_lambda(sampler, s, t, p, lodbias);
+ if (lambda < 0.5) { /* XXX this may need tweaking... */
+ *imgFilter = sampler->state->mag_img_filter;
+ }
+ else {
+ *imgFilter = sampler->state->min_img_filter;
+ }
+ }
}
else {
float lambda;