summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzesimir Nowak <krzesimir@kinvolk.io>2015-09-10 14:15:52 +0200
committerBrian Paul <brianp@vmware.com>2015-09-10 09:45:13 -0600
commitbdc69552ca0268fa489daa215dff7db96fdbeb1d (patch)
treee1c84426c4504c9db9c50edfaafe9c66e54604b3
parent85500fe2e154c1664dc3a89f1e58e9a9c0dff012 (diff)
softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value
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>
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 565fca632c6..19188b03bb5 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -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: