[Mesa-dev] [PATCH 1/2] st/mesa: release sampler views when redefining a texture in st_context_teximage

Marek Olšák maraeo at gmail.com
Fri Jul 28 00:27:40 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

Noticed randomly.

Cc: 17.2 <mesa-stable at lists.freedesktop.org>
---
 src/mesa/state_tracker/st_manager.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 62924b0..4b4d4ac 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -41,20 +41,21 @@
 #include "util/hash_table.h"
 #include "st_texture.h"
 
 #include "st_context.h"
 #include "st_debug.h"
 #include "st_extensions.h"
 #include "st_format.h"
 #include "st_cb_fbo.h"
 #include "st_cb_flush.h"
 #include "st_manager.h"
+#include "st_sampler_view.h"
 
 #include "state_tracker/st_gl_api.h"
 
 #include "pipe/p_context.h"
 #include "pipe/p_screen.h"
 #include "util/u_format.h"
 #include "util/u_pointer.h"
 #include "util/u_inlines.h"
 #include "util/u_atomic.h"
 #include "util/u_surface.h"
@@ -728,20 +729,21 @@ st_context_teximage(struct st_context_iface *stctxi,
       }
    }
    else {
       _mesa_clear_texture_image(ctx, texImage);
       width = height = depth = 0;
    }
 
    pipe_resource_reference(&stImage->pt, tex);
    stObj->surface_format = pipe_format;
 
+   st_texture_release_all_sampler_views(st, stObj);
    stObj->needs_validation = true;
 
    _mesa_dirty_texobj(ctx, texObj);
    _mesa_unlock_texture(ctx, texObj);
 
    return TRUE;
 }
 
 static void
 st_context_copy(struct st_context_iface *stctxi,
-- 
2.7.4



More information about the mesa-dev mailing list