aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-10-16 17:21:39 -0700
committerEric Anholt <[email protected]>2012-10-22 17:36:52 -0700
commitce086ebd89633d8d967cd65bacf5b05c1ac555ed (patch)
treeee98bd032680dc203d945193878e59a7e7a41cd3 /src/mesa/main
parente755c1a36b27d6e45f0ae81729908342b8775c74 (diff)
mesa: Throw an error for a new query on an already-active query target.
There's a similar test below, but it's not the same: that one checks whether this query object is already active (potentially on another target). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/queryobj.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 18792cf6c0e..ac036490849 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -301,6 +301,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
return;
}
+ /* From the GL_ARB_occlusion_query spec:
+ *
+ * "If BeginQueryARB is called while another query is already in
+ * progress with the same target, an INVALID_OPERATION error is
+ * generated."
+ */
+ if (*bindpt) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(target=%s is active)",
+ _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
if (id == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery{Indexed}(id==0)");
return;