summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index a15bd43166d..c54e9d385c2 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -474,7 +474,8 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
{
if (sampler->state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
/* no mipmap selection needed */
- *level0 = *level1 = (int) sampler->state->min_lod;
+ *level0 = *level1 = CLAMP((int) sampler->state->min_lod,
+ 0, (int) sampler->texture->last_level);
if (sampler->state->min_img_filter != sampler->state->mag_img_filter) {
/* non-mipmapped texture, but still need to determine if doing