st/mesa: Invalidate sampler view when texture object changes.
authorMichal Krol <michal@vmware.com>
Tue, 16 Mar 2010 18:39:09 +0000 (19:39 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 16 Mar 2010 18:40:15 +0000 (19:40 +0100)
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_gen_mipmap.c

index 6ed1c60a51efd5fafd3954d1e1803e17ea0a4301..3ef030f5a9bdf76c64dcdfec94401d1b6f0fba42 100644 (file)
@@ -571,6 +571,7 @@ st_TexImage(GLcontext * ctx,
          DBG("release it\n");
          pipe_texture_reference(&stObj->pt, NULL);
          assert(!stObj->pt);
+         pipe_sampler_view_reference(&stObj->sampler_view, NULL);
          stObj->teximage_realloc = FALSE;
       }
    }
@@ -1807,6 +1808,7 @@ st_finalize_texture(GLcontext *ctx,
        firstImage->pt != stObj->pt &&
        firstImage->pt->last_level >= stObj->lastLevel) {
       pipe_texture_reference(&stObj->pt, firstImage->pt);
+      pipe_sampler_view_reference(&stObj->sampler_view, NULL);
    }
 
    /* bytes per pixel block (blocks are usually 1x1) */
@@ -1826,6 +1828,7 @@ st_finalize_texture(GLcontext *ctx,
           stObj->pt->depth0 != firstImage->base.Depth2)
       {
          pipe_texture_reference(&stObj->pt, NULL);
+         pipe_sampler_view_reference(&stObj->sampler_view, NULL);
          ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER;
       }
    }
index 97f6903f9e2d20de42fec352dc2926fde58ce257..030b0a0f0655ce7bbc7d053f15be823504d84acb 100644 (file)
@@ -256,6 +256,7 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
 
       /* release the old tex (will likely be freed too) */
       pipe_texture_reference(&oldTex, NULL);
+      pipe_sampler_view_reference(&stObj->sampler_view, NULL);
 
       pt = stObj->pt;
    }