summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/transformfeedback.c39
-rw-r--r--src/mesa/main/transformfeedback.h5
2 files changed, 27 insertions, 17 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index 8eccdc20b76..06719b1ce82 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -198,6 +198,27 @@ _mesa_init_transform_feedback_object(struct gl_transform_feedback_object *obj,
obj->EverBound = GL_FALSE;
}
+/**
+ * Delete a transform feedback object. Called via
+ * ctx->Driver->DeleteTransformFeedback, if not overwritten by driver. In
+ * the latter case, called from the driver after all driver-specific clean-up
+ * has been done.
+ *
+ * \param ctx GL context to wich transform feedback object belongs.
+ * \param obj Transform feedback object due to be deleted.
+ */
+void
+_mesa_delete_transform_feedback_object(struct gl_context *ctx,
+ struct gl_transform_feedback_object
+ *obj)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(obj->Buffers); i++) {
+ _mesa_reference_buffer_object(ctx, &obj->Buffers[i], NULL);
+ }
+
+ free(obj->Label);
+ free(obj);
+}
/** Default fallback for ctx->Driver.NewTransformFeedback() */
static struct gl_transform_feedback_object *
@@ -213,22 +234,6 @@ new_transform_feedback_fallback(struct gl_context *ctx, GLuint name)
return obj;
}
-/** Default fallback for ctx->Driver.DeleteTransformFeedback() */
-static void
-delete_transform_feedback_fallback(struct gl_context *ctx,
- struct gl_transform_feedback_object *obj)
-{
- GLuint i;
-
- for (i = 0; i < ARRAY_SIZE(obj->Buffers); i++) {
- _mesa_reference_buffer_object(ctx, &obj->Buffers[i], NULL);
- }
-
- free(obj->Label);
- free(obj);
-}
-
-
/** Default fallback for ctx->Driver.BeginTransformFeedback() */
static void
begin_transform_feedback_fallback(struct gl_context *ctx, GLenum mode,
@@ -270,7 +275,7 @@ void
_mesa_init_transform_feedback_functions(struct dd_function_table *driver)
{
driver->NewTransformFeedback = new_transform_feedback_fallback;
- driver->DeleteTransformFeedback = delete_transform_feedback_fallback;
+ driver->DeleteTransformFeedback = _mesa_delete_transform_feedback_object;
driver->BeginTransformFeedback = begin_transform_feedback_fallback;
driver->EndTransformFeedback = end_transform_feedback_fallback;
driver->PauseTransformFeedback = pause_transform_feedback_fallback;
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 78a6c3377dd..063e295a2ec 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -108,6 +108,11 @@ extern void
_mesa_init_transform_feedback_object(struct gl_transform_feedback_object *obj,
GLuint name);
+extern void
+_mesa_delete_transform_feedback_object(struct gl_context *ctx,
+ struct gl_transform_feedback_object
+ *obj);
+
struct gl_transform_feedback_object *
_mesa_lookup_transform_feedback_object(struct gl_context *ctx, GLuint name);