[Mesa-dev] [PATCH 10/12] i965: Set query->flush after flushing the query

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 4 20:01:14 UTC 2017


Skip the next check for brw_batch_references() by recording when we
flush the query.
---
 src/mesa/drivers/dri/i965/gen6_queryobj.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c b/src/mesa/drivers/dri/i965/gen6_queryobj.c
index 0ba6919374..30dda5ae1f 100644
--- a/src/mesa/drivers/dri/i965/gen6_queryobj.c
+++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c
@@ -502,14 +502,16 @@ gen6_end_query(struct gl_context *ctx, struct gl_query_object *q)
 static void
 flush_batch_if_needed(struct brw_context *brw, struct brw_query_object *query)
 {
+   if (query->flushed)
+      return;
+
    /* If the batch doesn't reference the BO, it must have been flushed
     * (for example, due to being full).  Record that it's been flushed.
     */
-   query->flushed = query->flushed ||
-                    !brw_batch_references(&brw->batch, query->bo);
-
-   if (!query->flushed)
+   if (brw_batch_references(&brw->batch, query->bo))
       intel_batchbuffer_flush(brw);
+
+   query->flushed = true;
 }
 
 /**
-- 
2.13.3



More information about the mesa-dev mailing list