mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
gallium: implement min vs. mag filter determination for non-mipmapped textures
Fixes tests/minmag.c
This commit is contained in:
parent
f9973b1c3d
commit
08c9534107
1 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue