Mesa (master): svga: use pipe_sampler_view_release() in svga_cleanup_tss_binding()

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 25 23:01:09 UTC 2013


Module: Mesa
Branch: master
Commit: c1d35aece0afc2822d6d9f6c22664c04e6fcbba3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1d35aece0afc2822d6d9f6c22664c04e6fcbba3

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Nov 27 15:17:27 2012 -0700

svga: use pipe_sampler_view_release() in svga_cleanup_tss_binding()

Fixes a crash when the Redway3D Turbine demo exits.  We've made this
change in other places in the past.  The root issue is texture objects
are being shared by multiple contexts and sampler views get shared too.
Sampler views have a context pointer and if that context gets deleted
we may try to reference that context when finally deleting the sampler
view.

pipe_sampler_view_release() avoids this problem because it takes
an explicit context.

Reviewed-by: Zack Rusin <zackr at vmware.com>

---

 src/gallium/drivers/svga/svga_state_tss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_state_tss.c b/src/gallium/drivers/svga/svga_state_tss.c
index 572eeab..861a0df 100644
--- a/src/gallium/drivers/svga/svga_state_tss.c
+++ b/src/gallium/drivers/svga/svga_state_tss.c
@@ -45,7 +45,7 @@ void svga_cleanup_tss_binding(struct svga_context *svga)
       struct svga_hw_view_state *view = &svga->state.hw_draw.views[i];
 
       svga_sampler_view_reference(&view->v, NULL);
-      pipe_sampler_view_reference( &svga->curr.sampler_views[i], NULL );
+      pipe_sampler_view_release(&svga->pipe, &svga->curr.sampler_views[i]);
       pipe_resource_reference( &view->texture, NULL );
 
       view->dirty = 1;




More information about the mesa-commit mailing list