On 10/17/2013 12:14 PM, Carl Worth wrote:
There is nothing in the OpenGL specification which prevents the user from
calling glGenQueries to generate a new query object while another object is
active. Neither is there anything in the Mesa implementation which prevents
this. So remove the INVALID_OPERATION errors in this case.

I guess I wrote that code back when I implemented occlusion queries.

But from http://www.opengl.org/registry/specs/ARB/occlusion_query.txt:

"""
    Calling either GenQueriesARB or DeleteQueriesARB while any query of
    any target is active causes an INVALID_OPERATION error to be
    generated.
"""
(it's about half-way down in the file) It's also mentioned in the "Errors" section.


Maybe that was rescinded since that spec was done. If so, I'm fine with removing the code.

However, I wouldn't be surprised if our drivers crashed and burned if an active query is deleted. gl_query_object isn't referenced counted.

-Brian



Similarly, it is explicitly allowed by the OpenGL specification to delete an
active query, so remove the assertion for that case.

CC: <mesa-sta...@lists.freedesktop.org>
---
  src/mesa/main/queryobj.c | 15 ---------------
  1 file changed, 15 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index a180133..c98b2c7 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -202,13 +202,6 @@ _mesa_GenQueries(GLsizei n, GLuint *ids)
        return;
     }

-   /* No query objects can be active at this time! */
-   if (ctx->Query.CurrentOcclusionObject ||
-       ctx->Query.CurrentTimerObject) {
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB");
-      return;
-   }
-
     first = _mesa_HashFindFreeKeyBlock(ctx->Query.QueryObjects, n);
     if (first) {
        GLsizei i;
@@ -241,18 +234,10 @@ _mesa_DeleteQueries(GLsizei n, const GLuint *ids)
        return;
     }

-   /* No query objects can be active at this time! */
-   if (ctx->Query.CurrentOcclusionObject ||
-       ctx->Query.CurrentTimerObject) {
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB");
-      return;
-   }
-
     for (i = 0; i < n; i++) {
        if (ids[i] > 0) {
           struct gl_query_object *q = _mesa_lookup_query_object(ctx, ids[i]);
           if (q) {
-            ASSERT(!q->Active); /* should be caught earlier */
              _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]);
              ctx->Driver.DeleteQuery(ctx, q);
           }


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to