gallium: implement min vs. mag filter determination for non-mipmapped textures

Fixes tests/minmag.c
This commit is contained in:
Brian 2008-02-16 10:05:01 -07:00
parent f9973b1c3d
commit 08c9534107

View file

@ -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;