mesa: add end_conditional_render() render
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Jul 2017 09:09:16 +0000 (11:09 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 2 Aug 2017 10:54:31 +0000 (12:54 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/condrender.c

index 24a7f4b6945676ede9501a53499919fb92515765..051cd8f9629aba6cb13e911442cc9b1bb316b25a 100644 (file)
@@ -133,23 +133,30 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
 }
 
 
+static void
+end_conditional_render(struct gl_context *ctx)
+{
+   FLUSH_VERTICES(ctx, 0x0);
+
+   if (ctx->Driver.EndConditionalRender)
+      ctx->Driver.EndConditionalRender(ctx, ctx->Query.CondRenderQuery);
+
+   ctx->Query.CondRenderQuery = NULL;
+   ctx->Query.CondRenderMode = GL_NONE;
+}
+
+
 void APIENTRY
 _mesa_EndConditionalRender(void)
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   FLUSH_VERTICES(ctx, 0x0);
-
    if (!ctx->Extensions.NV_conditional_render || !ctx->Query.CondRenderQuery) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glEndConditionalRender()");
       return;
    }
 
-   if (ctx->Driver.EndConditionalRender)
-      ctx->Driver.EndConditionalRender(ctx, ctx->Query.CondRenderQuery);
-
-   ctx->Query.CondRenderQuery = NULL;
-   ctx->Query.CondRenderMode = GL_NONE;
+   end_conditional_render(ctx);
 }