_mesa_EndQueryARB(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
- struct occlusion_query *q;
+ struct occlusion_query *q = NULL;
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_DEPTH);
return;
}
- q = (struct occlusion_query *)
- _mesa_HashLookup(ctx->Occlusion.QueryObjects,
- ctx->Occlusion.CurrentQueryObject);
+ if (ctx->Occlusion.CurrentQueryObject)
+ q = (struct occlusion_query *)
+ _mesa_HashLookup(ctx->Occlusion.QueryObjects,
+ ctx->Occlusion.CurrentQueryObject);
if (!q || !q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glEndQuery with glBeginQuery");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEndQuery with no glBeginQuery");
return;
}
_mesa_HashLookup(ctx->Occlusion.QueryObjects, id);
if (!q || q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB(id=%d)", id);
return;
}
q = (struct occlusion_query *)
_mesa_HashLookup(ctx->Occlusion.QueryObjects, id);
if (!q || q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB(id=%d", id);
return;
}