Mesa (mesa_7_5_branch): mesa: add default function for ctx->Driver. CheckQuery() hook

Brian Paul brianp at kemper.freedesktop.org
Thu Jun 11 20:59:48 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 322e8556b91ceb80d4a53129cbb5db99087085f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=322e8556b91ceb80d4a53129cbb5db99087085f1

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jun 11 14:55:14 2009 -0600

mesa: add default function for ctx->Driver.CheckQuery() hook

---

 src/mesa/drivers/common/driverfuncs.c |    1 +
 src/mesa/main/queryobj.c              |   16 +++++++++++++++-
 src/mesa/main/queryobj.h              |    3 +++
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 276da41..6a98c29 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -231,6 +231,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    driver->BeginQuery = _mesa_begin_query;
    driver->EndQuery = _mesa_end_query;
    driver->WaitQuery = _mesa_wait_query;
+   driver->CheckQuery = _mesa_check_query;
 
    /* APPLE_vertex_array_object */
    driver->NewArrayObject = _mesa_new_array_object;
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 554e0b0..c25b31a 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -83,13 +83,27 @@ void
 _mesa_wait_query(GLcontext *ctx, struct gl_query_object *q)
 {
    /* For software drivers, _mesa_end_query() should have completed the query.
-    * For real hardware, implement a proper WaitQuery() driver function.
+    * For real hardware, implement a proper WaitQuery() driver function,
+    * which may require issuing a flush.
     */
    assert(q->Ready);
 }
 
 
 /**
+ * Check if a query results are ready.  Software driver fallback.
+ * Called via ctx->Driver.CheckQuery().
+ */
+void
+_mesa_check_query(GLcontext *ctx, struct gl_query_object *q)
+{
+   /* No-op for sw rendering.
+    * HW drivers may need to flush at this time.
+    */
+}
+
+
+/**
  * Delete a query object.  Called via ctx->Driver.DeleteQuery().
  * Not removed from hash table here.
  */
diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h
index 9a97746..bc02b65 100644
--- a/src/mesa/main/queryobj.h
+++ b/src/mesa/main/queryobj.h
@@ -48,6 +48,9 @@ _mesa_end_query(GLcontext *ctx, struct gl_query_object *q);
 extern void
 _mesa_wait_query(GLcontext *ctx, struct gl_query_object *q);
 
+extern void
+_mesa_check_query(GLcontext *ctx, struct gl_query_object *q);
+
 
 extern void GLAPIENTRY
 _mesa_GenQueriesARB(GLsizei n, GLuint *ids);




More information about the mesa-commit mailing list