X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fcondrender.c;h=bfd2b08180727494d7cd7d81c3095983a50a5ead;hb=c6ed42a89ede459e72b18cd8890cc3aba39905f5;hp=c8195a520cf3187eae8351c46f95f8ffb4b2da0e;hpb=7371224c069357319b3f2ee9e9b017fc284897cb;p=mesa.git diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c index c8195a520cf..bfd2b081807 100644 --- a/src/mesa/main/condrender.c +++ b/src/mesa/main/condrender.c @@ -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 "