From 514e0809a42027e2178bf0eccd526a08da60f399 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 11 Mar 2013 09:17:45 +0100 Subject: fontconfig libX11 mesa pixman xserver xkeyboard-config git update 11 Mar 2013 xserver commit 5047810a4c20fab444b8c6eb146c55dcdb0d4219 xkeyboard-config commit 2ed85c1e936f7cd4a9540ace5c12b9fec60ee1fb libX11 commit 3996543c1b2919e97d61a5d70fe1ebd7cd76fc83 pixman commit aaae3d8eefa069098e9014822817ca1429fdea46 fontconfig commit bdf1581e3de5528f397f19bfd4ca9caaf9e7fe4a mesa commit b21a9d46e4be0c666327569f07b9cddeb4d42d38 --- mesalib/src/mesa/main/samplerobj.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mesalib/src/mesa/main/samplerobj.c') diff --git a/mesalib/src/mesa/main/samplerobj.c b/mesalib/src/mesa/main/samplerobj.c index 319a444d7..5cff32936 100644 --- a/mesalib/src/mesa/main/samplerobj.c +++ b/mesalib/src/mesa/main/samplerobj.c @@ -40,7 +40,7 @@ #include "main/samplerobj.h" -static struct gl_sampler_object * +struct gl_sampler_object * _mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name) { if (name == 0) @@ -206,9 +206,19 @@ _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers) for (i = 0; i < count; i++) { if (samplers[i]) { + GLuint j; struct gl_sampler_object *sampObj = _mesa_lookup_samplerobj(ctx, samplers[i]); + if (sampObj) { + /* If the sampler is currently bound, unbind it. */ + for (j = 0; j < ctx->Const.MaxCombinedTextureImageUnits; j++) { + if (ctx->Texture.Unit[j].Sampler == sampObj) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[j].Sampler, NULL); + } + } + /* The ID is immediately freed for re-use */ _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]); /* But the object exists until its reference count goes to zero */ -- cgit v1.2.3