Use texture->first_level, not 0, when not mipmapping.
authorBrian <brian.paul@tungstengraphics.com>
Fri, 28 Sep 2007 19:49:50 +0000 (13:49 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 28 Sep 2007 21:39:39 +0000 (15:39 -0600)
Fixes crash when GL_BASE_LEVEL!=0.
Also, remove old assertion.

src/mesa/pipe/softpipe/sp_tex_sample.c

index 40d0cf40ae462e58a6c0f3434569a7c76e99916b..0c990294f28f8b9e220c0fc3616724ac739749a4 100644 (file)
@@ -479,10 +479,8 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
 {
    if (sampler->state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
       /* no mipmap selection needed */
-      assert(sampler->state->min_img_filter ==
-             sampler->state->mag_img_filter);
       *imgFilter = sampler->state->mag_img_filter;
-      *level0 = *level1 = 0;
+      *level0 = *level1 = sampler->texture->first_level;
    }
    else {
       float lambda;
@@ -497,7 +495,7 @@ choose_mipmap_levels(struct tgsi_sampler *sampler,
       if (lambda < 0.0) { /* XXX threshold depends on the filter */
          /* magnifying */
          *imgFilter = sampler->state->mag_img_filter;
-         *level0 = *level1 = 0;
+         *level0 = *level1 = sampler->texture->first_level;
       }
       else {
          /* minifying */