st/mesa: Unreference the sampler view in st_bind_surface.
authorChia-I Wu <olv@lunarg.com>
Sat, 30 Oct 2010 17:13:27 +0000 (01:13 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 30 Oct 2010 17:18:59 +0000 (01:18 +0800)
Without this, update_textures may not pick up the new pipe_resource.

It is actually update_textures that should check
stObj->sampler_view->texture != stObj->pt, but let's follow st_TexImage
and others for now.

src/mesa/state_tracker/st_cb_eglimage.c

index 298f8a5b12bc2ba6f93b62dec0edcdac802fe907..b39a624a612c4f20be026ee8909dbd86645700f1 100644 (file)
@@ -129,6 +129,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
 
    /* FIXME create a non-default sampler view from the pipe_surface? */
    pipe_resource_reference(&stObj->pt, ps->texture);
+   pipe_sampler_view_reference(&stObj->sampler_view, NULL);
    pipe_resource_reference(&stImage->pt, stObj->pt);
 
    stObj->width0 = ps->width;