summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-09-08 16:52:44 -0700
committerMarek Olšák <maraeo@gmail.com>2011-10-02 15:33:05 +0200
commit268a2c1a8a8e25136275315e5c5c53f3dc10dcac (patch)
tree16e34fba1d938f633134339ea9ac446c569e6675
parent28b95b2b0147318f97dc2ffd6492fee21fcf41c8 (diff)
mesa: Throw an error instead of asserting for condrender with query == 0.
From the NV_conditional_render spec: BeginQuery sets the active query object name for the query type given by <target> to <id>. If BeginQuery is called with an <id> of zero, if the active query object name for <target> is non-zero, if <id> is the active query object name for any query type, or if <id> is the active query object for condtional rendering (Section 2.X), the error INVALID OPERATION is generated. Fixes piglit nv_conditional_render-begin-zero. Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 7371224c069357319b3f2ee9e9b017fc284897cb)
-rw-r--r--src/mesa/main/condrender.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c
index 352e2e2b165..c8195a520cf 100644
--- a/src/mesa/main/condrender.c
+++ b/src/mesa/main/condrender.c
@@ -44,7 +44,8 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
struct gl_query_object *q;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery) {
+ if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery ||
+ queryId == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()");
return;
}