summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-10-16 17:26:05 -0700
committerEric Anholt <[email protected]>2012-10-22 17:36:53 -0700
commit8f1131fcc00333efd824642576addacbea57f4ba (patch)
tree056e561423f941b504900345da7ee0483566d8b2 /src/mesa
parentce086ebd89633d8d967cd65bacf5b05c1ac555ed (diff)
mesa: Refuse to EndQuery with a mismatched query target.
v2: Add a comment about what we're checking for. Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/queryobj.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index ac036490849..735e4d1b1ab 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -374,6 +374,16 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
/* XXX should probably refcount query objects */
q = *bindpt;
+
+ /* Check for GL_ANY_SAMPLES_PASSED vs GL_SAMPLES_PASSED. */
+ if (q && q->Target != target) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEndQuery(target=%s with active query of target %s)",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(q->Target));
+ return;
+ }
+
*bindpt = NULL;
if (!q || !q->Active) {