sampler->normalized_coords = 1;
sampler->lod_bias = st->ctx->Texture.Unit[su].LodBias;
- sampler->min_lod = MAX2(texobj->BaseLevel, texobj->MinLod);
- sampler->max_lod = MIN2(texobj->MaxLevel, texobj->MaxLod);
+ sampler->min_lod = MAX2(0.0f, texobj->MinLod - texobj->BaseLevel);
+ sampler->max_lod = MIN2(texobj->MaxLevel - texobj->BaseLevel,
+ texobj->MaxLod);
sampler->border_color[0] = texobj->BorderColor[RCOMP];
sampler->border_color[1] = texobj->BorderColor[GCOMP];
}
else {
firstLevel = 0;
- lastLevel = MIN2(tObj->MaxLevel, tObj->Image[0][0]->WidthLog2);
+ lastLevel = MIN2(tObj->MaxLevel, tObj->Image[0][tObj->BaseLevel]->WidthLog2);
}
break;
case GL_TEXTURE_RECTANGLE_NV:
st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat) ||
stObj->pt->last_level < stObj->lastLevel ||
stObj->pt->cpp != cpp ||
+ stObj->pt->width[0] != firstImage->base.Width2 ||
+ stObj->pt->height[0] != firstImage->base.Height2 ||
+ stObj->pt->depth[0] != firstImage->base.Depth2 ||
stObj->pt->compressed != firstImage->base.IsCompressed)) {
pipe_texture_release(&stObj->pt);
}