#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"
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);
}
+#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.
*
}
}
+#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).