gallium: tweak texture filter min/mag thresholds
This commit is contained in:
parent
08c9534107
commit
3b2a291888
|
@ -474,7 +474,6 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
|
||||||
{
|
{
|
||||||
if (sampler->state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
|
if (sampler->state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
|
||||||
/* no mipmap selection needed */
|
/* no mipmap selection needed */
|
||||||
*imgFilter = sampler->state->mag_img_filter;
|
|
||||||
*level0 = *level1 = (int) sampler->state->min_lod;
|
*level0 = *level1 = (int) sampler->state->min_lod;
|
||||||
|
|
||||||
if (sampler->state->min_img_filter != sampler->state->mag_img_filter) {
|
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.
|
* minification or magnification.
|
||||||
*/
|
*/
|
||||||
float lambda = compute_lambda(sampler, s, t, p, lodbias);
|
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;
|
*imgFilter = sampler->state->mag_img_filter;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*imgFilter = sampler->state->min_img_filter;
|
*imgFilter = sampler->state->min_img_filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
*imgFilter = sampler->state->mag_img_filter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float lambda;
|
float lambda;
|
||||||
|
@ -500,7 +502,7 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
|
||||||
/* vertex shader */
|
/* vertex shader */
|
||||||
lambda = lodbias; /* not really a bias, but absolute LOD */
|
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 */
|
/* magnifying */
|
||||||
*imgFilter = sampler->state->mag_img_filter;
|
*imgFilter = sampler->state->mag_img_filter;
|
||||||
*level0 = *level1 = 0;
|
*level0 = *level1 = 0;
|
||||||
|
|
Loading…
Reference in New Issue