mesa: add end_transform_feedback() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 24 Aug 2017 10:01:27 +0000 (12:01 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 25 Aug 2017 09:35:29 +0000 (11:35 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/transformfeedback.c

index 525c5b7a5b80154a8ed285513df8f9f96f65377e..d1d695ce485cb00ccdff60b2a8305652f617958b 100644 (file)
@@ -495,6 +495,22 @@ _mesa_BeginTransformFeedback(GLenum mode)
 }
 
 
+static void
+end_transform_feedback(struct gl_context *ctx,
+                       struct gl_transform_feedback_object *obj)
+{
+   FLUSH_VERTICES(ctx, 0);
+   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
+
+   assert(ctx->Driver.EndTransformFeedback);
+   ctx->Driver.EndTransformFeedback(ctx, obj);
+
+   ctx->TransformFeedback.CurrentObject->Active = GL_FALSE;
+   ctx->TransformFeedback.CurrentObject->Paused = GL_FALSE;
+   ctx->TransformFeedback.CurrentObject->EndedAnytime = GL_TRUE;
+}
+
+
 void GLAPIENTRY
 _mesa_EndTransformFeedback(void)
 {
@@ -509,15 +525,7 @@ _mesa_EndTransformFeedback(void)
       return;
    }
 
-   FLUSH_VERTICES(ctx, 0);
-   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
-
-   assert(ctx->Driver.EndTransformFeedback);
-   ctx->Driver.EndTransformFeedback(ctx, obj);
-
-   ctx->TransformFeedback.CurrentObject->Active = GL_FALSE;
-   ctx->TransformFeedback.CurrentObject->Paused = GL_FALSE;
-   ctx->TransformFeedback.CurrentObject->EndedAnytime = GL_TRUE;
+   end_transform_feedback(ctx, obj);
 }