diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/queryobj.c | 23 | ||||
-rw-r--r-- | src/mesa/main/queryobj.h | 10 |
2 files changed, 17 insertions, 16 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index f6eb4ee7e1..387a82fc9d 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -118,15 +118,6 @@ _mesa_delete_query(GLcontext *ctx, struct gl_query_object *q) } -static struct gl_query_object * -lookup_query_object(GLcontext *ctx, GLuint id) -{ - return (struct gl_query_object *) - _mesa_HashLookup(ctx->Query.QueryObjects, id); -} - - - void _mesa_init_query_object_functions(struct dd_function_table *driver) { @@ -196,7 +187,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) for (i = 0; i < n; i++) { if (ids[i] > 0) { - struct gl_query_object *q = lookup_query_object(ctx, ids[i]); + 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]); @@ -213,7 +204,7 @@ _mesa_IsQueryARB(GLuint id) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (id && lookup_query_object(ctx, id)) + if (id && _mesa_lookup_query_object(ctx, id)) return GL_TRUE; else return GL_FALSE; @@ -260,7 +251,7 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } - q = lookup_query_object(ctx, id); + q = _mesa_lookup_query_object(ctx, id); if (!q) { /* create new object */ q = ctx->Driver.NewQueryObject(ctx, id); @@ -386,7 +377,7 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (id) - q = lookup_query_object(ctx, id); + q = _mesa_lookup_query_object(ctx, id); if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -426,7 +417,7 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (id) - q = lookup_query_object(ctx, id); + q = _mesa_lookup_query_object(ctx, id); if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -469,7 +460,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (id) - q = lookup_query_object(ctx, id); + q = _mesa_lookup_query_object(ctx, id); if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -506,7 +497,7 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (id) - q = lookup_query_object(ctx, id); + q = _mesa_lookup_query_object(ctx, id); if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index 6cf3c76d74..ba8b5dd002 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -28,6 +28,7 @@ #include "main/mtypes.h" +#include "main/hash.h" #if FEATURE_queryobj @@ -42,6 +43,15 @@ (driver)->CheckQuery = impl ## CheckQuery; \ } while (0) + +static INLINE struct gl_query_object * +_mesa_lookup_query_object(GLcontext *ctx, GLuint id) +{ + return (struct gl_query_object *) + _mesa_HashLookup(ctx->Query.QueryObjects, id); +} + + extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); |