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.
---

Sorry I missed this test update when I submitted and pushed the recent
patches to Mesa implementing this behavior.

 tests/glean/toccluqry.cpp | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/tests/glean/toccluqry.cpp b/tests/glean/toccluqry.cpp
index 580c346..0ea2d37 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;
                }
        }
-- 
1.8.4.rc3

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to