summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2015-02-09 11:32:43 +0100
committerIago Toral Quiroga <[email protected]>2015-02-24 08:58:53 +0100
commitdccdf1d687c3abb9a2fc6695c2090f01fdb65997 (patch)
tree6678d44636a989731d173e4abd19f62ad520929c /src/mesa/main
parent36998664630e1e846011fd8436fd02476e1b647e (diff)
mesa: Return error if BeginQuery is called with an existing object of different type
Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 spec states: "BeginQuery generates an INVALID_OPERATION error if any of the following conditions hold: [...] id is the name of an existing query object whose type does not match target; [...] Similar wording exists in the OpenGL 4.5 spec, section 4.2. QUERY OBJECTS AND ASYNCHRONOUS QUERIES, page 43. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.fragment.begin_query Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/queryobj.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index e00ab9476fc..e02969d2ed7 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -405,6 +405,22 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
"glBeginQuery{Indexed}(query already active)");
return;
}
+
+ /* Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4
+ * spec states:
+ *
+ * "BeginQuery generates an INVALID_OPERATION error if any of the
+ * following conditions hold: [...] id is the name of an
+ * existing query object whose type does not match target; [...]
+ *
+ * Similar wording exists in the OpenGL 4.5 spec, section 4.2. QUERY
+ * OBJECTS AND ASYNCHRONOUS QUERIES, page 43.
+ */
+ if (q->EverBound && q->Target != target) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(target mismatch)");
+ return;
+ }
}
q->Target = target;