diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-02-16 13:55:47 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-02-16 13:55:47 -0700 |
commit | 0c6bbd41bd6dc1041eaca7c907d3768d107c1afa (patch) | |
tree | 54bf7e870c110af05940ff3e58720d75d2ae4098 /src | |
parent | 3b2a291888d8e62787de03f8529806fb562bd186 (diff) |
gallium: add missing mip level clamp
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.c | 3 |
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 a15bd43166..c54e9d385c 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 |