aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorYevhenii Kolesnikov <[email protected]>2019-08-01 16:05:29 +0300
committerEric Anholt <[email protected]>2019-08-07 17:25:22 +0000
commit0325860e90f928b7022edfe2d0355cbf0c496463 (patch)
tree511cfe74f45464c4eb7be65b02739fa8e1deb857 /src/mesa/main
parent4f767ded6effc60f7542089f368614f3d51bbba5 (diff)
mesa: Use _mesa_delete_transform_feedback_object in drivers
Function _mesa_delete_transform_feedback_object called from within drivers once driver-specific clean-up has been done. Brings into conformity with how other GL objects are handled. CC: Eric Anholt <[email protected]> CC: Kenneth Graunke <[email protected]> Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
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);