aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shared.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-12 13:48:18 +0000
committermarha <marha@users.sourceforge.net>2011-04-12 13:48:18 +0000
commite2c8d047679db3bbb166d709b86e18180be6d713 (patch)
treed7468ac76dc71bb8d38c816be6db988bcbcbb863 /mesalib/src/mesa/main/shared.c
parent57fb3f76b66c5f7a9f7bed9c42fb9fec9d56ee05 (diff)
parent7730393619080086530e24d3b594351b4114f608 (diff)
downloadvcxsrv-e2c8d047679db3bbb166d709b86e18180be6d713.tar.gz
vcxsrv-e2c8d047679db3bbb166d709b86e18180be6d713.tar.bz2
vcxsrv-e2c8d047679db3bbb166d709b86e18180be6d713.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/shared.c')
-rw-r--r--mesalib/src/mesa/main/shared.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index 22b3bbdd4..8937e5a5f 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -40,6 +40,9 @@
#include "shared.h"
#include "program/program.h"
#include "dlist.h"
+#if FEATURE_ARB_sampler_objects
+#include "samplerobj.h"
+#endif
#include "shaderobj.h"
#include "syncobj.h"
@@ -91,6 +94,11 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
shared->BufferObjects = _mesa_NewHashTable();
#endif
+#if FEATURE_ARB_sampler_objects
+ /* GL_ARB_sampler_objects */
+ shared->SamplerObjects = _mesa_NewHashTable();
+#endif
+
/* Allocate the default buffer object */
shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
@@ -270,6 +278,20 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData)
}
+#if FEATURE_ARB_sampler_objects
+/**
+ * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_sampler_object_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_context *ctx = (struct gl_context *) userData;
+ struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data;
+ _mesa_reference_sampler_object(ctx, &sampObj, NULL);
+}
+#endif
+
+
/**
* Deallocate a shared state object and all children structures.
*
@@ -345,6 +367,11 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
}
}
+#if FEATURE_ARB_sampler_objects
+ _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx);
+ _mesa_DeleteHashTable(shared->SamplerObjects);
+#endif
+
/*
* Free texture objects (after FBOs since some textures might have
* been bound to FBOs).