From ad1479580559f6dc5bbe6eb9527b3aa82268c826 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 27 Sep 2018 12:14:26 +0200 Subject: [PATCH] iris: flush batch when asking for result via QBO --- src/gallium/drivers/iris/iris_query.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 7ae346a52c7..fac5e6b5e99 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -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); -- 2.30.2