mesa: add resume_transform_feedback() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 24 Aug 2017 10:09:23 +0000 (12:09 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 25 Aug 2017 09:35:30 +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 c7db48c593b0b3b14cbc333d36c128ab6f0f1f45..02867b5b8906b458ae6b4ec79209f6524c587a14 100644 (file)
@@ -1237,6 +1237,20 @@ _mesa_PauseTransformFeedback(void)
  * Resume transform feedback.
  * Part of GL_ARB_transform_feedback2.
  */
+static void
+resume_transform_feedback(struct gl_context *ctx,
+                          struct gl_transform_feedback_object *obj)
+{
+   FLUSH_VERTICES(ctx, 0);
+   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
+
+   obj->Paused = GL_FALSE;
+
+   assert(ctx->Driver.ResumeTransformFeedback);
+   ctx->Driver.ResumeTransformFeedback(ctx, obj);
+}
+
+
 void GLAPIENTRY
 _mesa_ResumeTransformFeedback(void)
 {
@@ -1262,13 +1276,7 @@ _mesa_ResumeTransformFeedback(void)
       return;
    }
 
-   FLUSH_VERTICES(ctx, 0);
-   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
-
-   obj->Paused = GL_FALSE;
-
-   assert(ctx->Driver.ResumeTransformFeedback);
-   ctx->Driver.ResumeTransformFeedback(ctx, obj);
+   resume_transform_feedback(ctx, obj);
 }
 
 extern void GLAPIENTRY