mesa: enable GL_EXT_draw_instanced for gles2
[mesa.git] / src / mesa / main / condrender.c
index 24a7f4b6945676ede9501a53499919fb92515765..320003aa73f218b36e5e4449d75d92f3324ed3f0 100644 (file)
@@ -133,23 +133,38 @@ _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)
+_mesa_EndConditionalRender_no_error(void)
 {
    GET_CURRENT_CONTEXT(ctx);
+   end_conditional_render(ctx);
+}
 
-   FLUSH_VERTICES(ctx, 0x0);
+
+void APIENTRY
+_mesa_EndConditionalRender(void)
+{
+   GET_CURRENT_CONTEXT(ctx);
 
    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);
 }