mesa: add pause_transform_feedback() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 24 Aug 2017 10:29:50 +0000 (12:29 +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 8e6ea9c9ca2d93cf80fb4f1f9a0195530c9e0c59..633b629a9d095941f642b32074197b95409bbb71 100644 (file)
@@ -1193,6 +1193,20 @@ _mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names)
  * Pause transform feedback.
  * Part of GL_ARB_transform_feedback2.
  */
+static void
+pause_transform_feedback(struct gl_context *ctx,
+                         struct gl_transform_feedback_object *obj)
+{
+   FLUSH_VERTICES(ctx, 0);
+   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
+
+   assert(ctx->Driver.PauseTransformFeedback);
+   ctx->Driver.PauseTransformFeedback(ctx, obj);
+
+   obj->Paused = GL_TRUE;
+}
+
+
 void GLAPIENTRY
 _mesa_PauseTransformFeedback(void)
 {
@@ -1207,13 +1221,7 @@ _mesa_PauseTransformFeedback(void)
       return;
    }
 
-   FLUSH_VERTICES(ctx, 0);
-   ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;
-
-   assert(ctx->Driver.PauseTransformFeedback);
-   ctx->Driver.PauseTransformFeedback(ctx, obj);
-
-   obj->Paused = GL_TRUE;
+   pause_transform_feedback(ctx, obj);
 }