summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-16 13:55:47 -0700
committerBrian <[email protected]>2008-02-16 13:55:47 -0700
commit0c6bbd41bd6dc1041eaca7c907d3768d107c1afa (patch)
tree54bf7e870c110af05940ff3e58720d75d2ae4098 /src/gallium/drivers/softpipe
parent3b2a291888d8e62787de03f8529806fb562bd186 (diff)
gallium: add missing mip level clamp
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