softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value
authorKrzesimir Nowak <krzesimir@kinvolk.io>
Thu, 10 Sep 2015 12:15:52 +0000 (14:15 +0200)
committerBrian Paul <brianp@vmware.com>
Thu, 10 Sep 2015 15:45:13 +0000 (09:45 -0600)
The level-of-detail bias wasn't simply added in the explicit LOD case.
This case seems to be tested only in piglit's
fs-texturequerylod-nearest-biased test, which is currently skipped, as
softpipe does not support textureQueryLod at the moment.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/softpipe/sp_tex_sample.c

index 565fca632c6726493be9ffa7a3ce361559eafc69..19188b03bb5e990045b629f030aa96de934454a9 100644 (file)
@@ -1892,7 +1892,7 @@ compute_lambda_lod(struct sp_sampler_view *sp_sview,
       break;
    case tgsi_sampler_lod_explicit:
       for (i = 0; i < TGSI_QUAD_SIZE; i++) {
-         lod[i] = CLAMP(lod_in[i], min_lod, max_lod);
+         lod[i] = CLAMP(lod_in[i] + lod_bias, min_lod, max_lod);
       }
       break;
    case tgsi_sampler_lod_zero: