summaryrefslogtreecommitdiff
path: root/tests/glean/toccluqry.cpp
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2013-10-30 17:17:03 -0700
committerCarl Worth <cworth@cworth.org>2013-10-31 09:51:34 -0700
commitcf6a41928fe8504e5d4949af0429483ffb546e27 (patch)
tree5a769307fc9a64d19ab7ba02711546102b5abfce /tests/glean/toccluqry.cpp
parente2ef577c50500ab9ea4e3d4c4f06dd3570db074f (diff)
glean: Fix occlusion query test: expect Gen/DeleteQueries while active to work
A recent inspection of the latest OpenGL specification revealed that there is no requirement for errors to be generated if GenQueries or DeleteQueries are called while a query is active. Specifically, in Section 4.2 of OpenGL 4.4 (Core Profile) the only errors specified for GenQueries and DeleteQueries is INVALID_VALUE if the ID is negative. Additionally, the same section specifies what to do in case the active query is deleted: If an active query object is deleted its name immediately becomes unused,... Implementing this requires that DeleteQueries be able to succeed when a query is active. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'tests/glean/toccluqry.cpp')
-rw-r--r--tests/glean/toccluqry.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/glean/toccluqry.cpp b/tests/glean/toccluqry.cpp
index 580c34604..0ea2d3751 100644
--- a/tests/glean/toccluqry.cpp
+++ b/tests/glean/toccluqry.cpp
@@ -377,8 +377,8 @@ bool OccluQryTest::conformOQ_EndAfter(GLuint id)
}
-/* Calling either GenQueriesARB while any query of any target is active causes
- * an INVALID_OPERATION error to be generated. */
+/* Calling either GenQueriesARB while any query of any target is active
+ * should not cause any error to be generated. */
bool OccluQryTest::conformOQ_GenIn(GLuint id)
{
int pass = true;
@@ -386,9 +386,9 @@ bool OccluQryTest::conformOQ_GenIn(GLuint id)
START_QUERY(id);
glGenQueriesARB_func(1, &id);
- if (glGetError() != GL_INVALID_OPERATION) {
- reportError("No GL_INVALID_OPERATION generated if "
- "GenQueries in the progress of another.");
+ if (glGetError() != GL_NO_ERROR) {
+ reportError("Error generated when GenQueries called "
+ "in the progress of another.");
pass = false;
}
@@ -398,20 +398,22 @@ bool OccluQryTest::conformOQ_GenIn(GLuint id)
}
-/* Calling either DeleteQueriesARB while any query of any target is active causes
- * an INVALID_OPERATION error to be generated. */
+/* Calling either DeleteQueriesARB while any query of any target is active
+ * should not cause any error to be generated. */
bool OccluQryTest::conformOQ_DeleteIn(GLuint id)
{
int pass = true;
+ unsigned int another_id;
START_QUERY(id);
if (id > 0) {
- glDeleteQueriesARB_func(1, &id);
+ glGenQueriesARB_func(1, &another_id);
+ glDeleteQueriesARB_func(1, &another_id);
- if (glGetError() != GL_INVALID_OPERATION) {
- reportError("No GL_INVALID_OPERATION generated if "
- "DeleteQueries in the progress of another.");
+ if (glGetError() != GL_NO_ERROR) {
+ reportError("Error generated when DeleteQueries called "
+ "in the progress of another.");
pass = false;
}
}