Mesa (master): gallium: document pipe_context::get_query_result()

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 29 21:03:09 UTC 2010


Module: Mesa
Branch: master
Commit: 98f3f1c695f232120541670a8b5a355003ce3cc8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98f3f1c695f232120541670a8b5a355003ce3cc8

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jan 29 12:36:26 2010 -0700

gallium: document pipe_context::get_query_result()

---

 src/gallium/docs/source/context.rst  |   12 +++++++++---
 src/gallium/include/pipe/p_context.h |    5 +++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst
index 78b01cc..a766957 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -148,9 +148,15 @@ draws.  Queries may be nested, though no state tracker currently
 exercises this.  
 
 Queries can be created with ``create_query`` and deleted with
-``destroy_query``. To enable a query, use ``begin_query``, and when finished,
-use ``end_query`` to stop the query. Finally, ``get_query_result`` is used
-to retrieve the results.
+``destroy_query``. To start a query, use ``begin_query``, and when finished,
+use ``end_query`` to end the query.
+
+``get_query_result`` is used to retrieve the results of a query.  If
+the ``wait`` parameter is TRUE, then the ``get_query_result`` call
+will block until the results of the query are ready (and TRUE will be
+returned).  Otherwise, if the ``wait`` parameter is FALSE, the call
+will not block and the return value will be TRUE if the query has
+completed or FALSE otherwise.
 
 A common type of query is the occlusion query which counts the number of
 fragments/pixels which are written to the framebuffer (and not culled by
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index f3ee095..f1e6a60 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -122,6 +122,11 @@ struct pipe_context {
    void (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
    void (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
 
+   /**
+    * Get results of a query.
+    * \param wait  if true, this query will block until the result is ready
+    * \return TRUE if results are ready, FALSE otherwise
+    */
    boolean (*get_query_result)(struct pipe_context *pipe, 
                                struct pipe_query *q,
                                boolean wait,




More information about the mesa-commit mailing list