diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 88e6128..32f68b5 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -152,6 +152,7 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
                                    stObj->pt,
                                    format);
    templ.u.tex.first_level = stObj->base.BaseLevel;
+   templ.u.tex.last_level = stObj->base._MaxLevel;
 
    if (swizzle != SWIZZLE_NOOP) {
       templ.swizzle_r = GET_SWZ(swizzle, 0);
@@ -241,7 +242,8 @@ update_single_texture(struct st_context *st,
 				stObj->base._Swizzle,
 				samp->DepthMode) ||
 	  (st_view_format != stObj->sampler_view->format) ||
-	  stObj->base.BaseLevel != stObj->sampler_view->u.tex.first_level) {
+	  stObj->base.BaseLevel != stObj->sampler_view->u.tex.first_level ||
+	  stObj->base._MaxLevel != stObj->sampler_view->u.tex.last_level) {
 	 pipe_sampler_view_reference(&stObj->sampler_view, NULL);
       }
    }
