Mesa (master): st/mesa: replace conditional with assertion

Brian Paul brianp at kemper.freedesktop.org
Wed Feb 17 16:02:44 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Feb 17 08:27:53 2010 -0700

st/mesa: replace conditional with assertion

Core Mesa will not call ctx->Driver.CheckQuery() if the Ready flag
is already set.

---

 src/mesa/state_tracker/st_cb_queryobj.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index 2281d10..dc40c5d 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -130,13 +130,8 @@ st_CheckQuery(GLcontext *ctx, struct gl_query_object *q)
 {
    struct pipe_context *pipe = ctx->st->pipe;
    struct st_query_object *stq = st_query_object(q);
-
-   if (!q->Ready) {
-      q->Ready = pipe->get_query_result(pipe, 
-					stq->pq,
-					FALSE,
-					&q->Result);
-   }
+   assert(!q->Ready);   /* we should not get called if Ready is TRUE */
+   q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, &q->Result);
 }
 
 




More information about the mesa-commit mailing list