Ejemplo n.º 1
0
void GLAPIENTRY
_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids)
{
   GLint i;
   GET_CURRENT_CONTEXT(ctx);
   ASSERT_OUTSIDE_BEGIN_END(ctx);

   if (n < 0) {
      _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)");
      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 = lookup_query_object(ctx, ids[i]);
         if (q) {
            ASSERT(!q->Active); /* should be caught earlier */
            _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]);
            delete_query_object(q);
         }
      }
   }
}
Ejemplo n.º 2
0
/**
 * Callback for deleting a query object.  Called by _mesa_HashDeleteAll().
 */
static void
delete_queryobj_cb(GLuint id, void *data, void *userData)
{
   struct gl_query_object *q= (struct gl_query_object *) data;
   (void) userData;
   delete_query_object(q);
}
Ejemplo n.º 3
0
/**
 * Free the context state related to query objects.
 */
void
_mesa_free_query_data(GLcontext *ctx)
{
    while (1) {
        GLuint id = _mesa_HashFirstEntry(ctx->Query.QueryObjects);
        if (id) {
            struct gl_query_object *q = lookup_query_object(ctx, id);
            ASSERT(q);
            delete_query_object(q);
            _mesa_HashRemove(ctx->Query.QueryObjects, id);
        }
        else {
            break;
        }
    }
    _mesa_DeleteHashTable(ctx->Query.QueryObjects);
}