iris: flush batch when asking for result via QBO
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 27 Sep 2018 10:14:26 +0000 (12:14 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:08 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_query.c

index 7ae346a52c72a413d68f770f01767a19a27e11a1..fac5e6b5e9965ac8c452d3fe1c697157d5f50285 100644 (file)
@@ -329,7 +329,14 @@ iris_get_query_result_resource(struct pipe_context *ctx,
       offsetof(struct iris_query_snapshots, snapshots_landed);
 
    if (index == -1) {
-      /* They're asking for the availability of the result. */
+      /* They're asking for the availability of the result.  If we still
+       * have commands queued up which produce the result, submit them
+       * now so that progress happens.  Either way, copy the snapshots
+       * landed field to the destination resource.
+       */
+      if (iris_batch_references(batch, q->bo))
+         iris_batch_flush(batch);
+
       ice->vtbl.copy_mem_mem(batch, iris_resource_bo(p_res), offset,
                              q->bo, snapshots_landed_offset,
                              result_type <= PIPE_QUERY_TYPE_U32 ? 4 : 8);