Mesa (main): anv: fix submission batching with perf queries

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 14:39:26 UTC 2021


Module: Mesa
Branch: main
Commit: b8e29e89366a5264391dc7c10e778330b7add66a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8e29e89366a5264391dc7c10e778330b7add66a

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Wed Jul 28 18:44:07 2021 +0300

anv: fix submission batching with perf queries

If we have 2 command buffers back to back, one with a query pool, one
without, we don't want to retain the second query pool value (NULL).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: 0a7224f3ff7542 ("anv: group as many command buffers into a single execbuf")
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12107>

---

 src/intel/vulkan/anv_queue.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index 28621d62564..bbeb5056c8e 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -1127,7 +1127,12 @@ anv_queue_submit_add_cmd_buffer(struct anv_queue_submit *submit,
    }
 
    submit->cmd_buffers[submit->cmd_buffer_count++] = cmd_buffer;
-   submit->perf_query_pool = cmd_buffer->perf_query_pool;
+   /* Only update the perf_query_pool if there is one. We can decide to batch
+    * 2 command buffers if the second one doesn't use a query pool, but we
+    * can't drop the already chosen one.
+    */
+   if (cmd_buffer->perf_query_pool)
+      submit->perf_query_pool = cmd_buffer->perf_query_pool;
    submit->perf_query_pass = perf_pass;
 
    return VK_SUCCESS;



More information about the mesa-commit mailing list