From cbfb19790917d271b8ca6156554b16acc802719f Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 28 Mar 2014 17:35:36 +0100 Subject: libxtrans fontconfig mesa xserver git update 28 Mar 2014 xserver commit a2880699e8f1f576e1a48ebf25e8982463323f84 libxtrans commit 68f60238c4224f954ff6556ae778c72e420175f0 fontconfig commit fcba9ef01c978323fc71c17e455d3cd6ae35edcc mesa commit 029ccd773d01a5f801c809c499516d7b0c4cc3f8 --- mesalib/src/mesa/state_tracker/st_context.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mesalib/src/mesa/state_tracker/st_context.c') diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c index 0ffc76263..807a86fdf 100644 --- a/mesalib/src/mesa/state_tracker/st_context.c +++ b/mesalib/src/mesa/state_tracker/st_context.c @@ -33,6 +33,7 @@ #include "main/shaderobj.h" #include "main/version.h" #include "main/vtxfmt.h" +#include "main/hash.h" #include "program/prog_cache.h" #include "vbo/vbo.h" #include "glapi/glapi.h" @@ -66,6 +67,7 @@ #include "st_gen_mipmap.h" #include "st_program.h" #include "st_vdpau.h" +#include "st_texture.h" #include "pipe/p_context.h" #include "util/u_inlines.h" #include "util/u_upload_mgr.h" @@ -280,6 +282,19 @@ static void st_destroy_context_priv( struct st_context *st ) free( st ); } + +/** + * Callback to release the sampler view attached to a texture object. + * Called by _mesa_HashWalk(). + */ +static void +destroy_tex_sampler_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + struct st_context *st = (struct st_context *) userData; + + st_texture_release_sampler_view(st, st_texture_object(texObj)); +} void st_destroy_context( struct st_context *st ) { @@ -288,6 +303,8 @@ void st_destroy_context( struct st_context *st ) struct gl_context *ctx = st->ctx; GLuint i; + _mesa_HashWalk(ctx->Shared->TexObjects, destroy_tex_sampler_cb, st); + /* need to unbind and destroy CSO objects before anything else */ cso_release_all(st->cso_context); -- cgit v1.2.3