mesa: Support EXT_framebuffer_blit targets in ES 3.0 as well.
[mesa.git] / src / mesa / main / condrender.c
index c8195a520cf3187eae8351c46f95f8ffb4b2da0e..bfd2b08180727494d7cd7d81c3095983a50a5ead 100644 (file)
@@ -73,7 +73,7 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
    }
    ASSERT(q->Id == queryId);
 
-   if (q->Target != GL_SAMPLES_PASSED) {
+   if (q->Target != GL_SAMPLES_PASSED || q->Active) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()");
       return;
    }
@@ -139,6 +139,8 @@ _mesa_check_conditional_render(struct gl_context *ctx)
    case GL_QUERY_BY_REGION_NO_WAIT:
       /* fall-through */
    case GL_QUERY_NO_WAIT:
+      if (!q->Ready)
+         ctx->Driver.CheckQuery(ctx, q);
       return q->Ready ? (q->Result > 0) : GL_TRUE;
    default:
       _mesa_problem(ctx, "Bad cond render mode %s in "