Mesa (staging/22.1): radv: Fix vkCmdCopyQueryResults -> vkCmdResetPool hazard.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 12 17:20:15 UTC 2022
Module: Mesa
Branch: staging/22.1
Commit: 95d522f4757107bb64ee487bdbb89833cbcf7edf
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=95d522f4757107bb64ee487bdbb89833cbcf7edf
Author: Tatsuyuki Ishi <ishitatsuyuki at gmail.com>
Date: Tue May 10 13:44:05 2022 +0900
radv: Fix vkCmdCopyQueryResults -> vkCmdResetPool hazard.
The Vulkan specification states:
> Query commands, for the same query and submitted to the same queue,
> execute in their entirety in submission order, relative to each other. In
> effect there is an implicit execution dependency from each such query
> command to all query commands previously submitted to the same queue.
Fixes dEQP-VK.query_pool.statistics_query.reset_after_copy.*
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17400>
(cherry picked from commit 768cd5715def2ee69b5084e9da83fcbe3228cdaa)
---
.pick_status.json | 2 +-
src/amd/vulkan/radv_query.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 812be9caf8f..4bdce42901b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1444,7 +1444,7 @@
"description": "radv: Fix vkCmdCopyQueryResults -> vkCmdResetPool hazard.",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index beff321005f..9db3d4ba2be 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -854,6 +854,13 @@ radv_query_shader(struct radv_cmd_buffer *cmd_buffer, VkPipeline *pipeline,
radv_unaligned_dispatch(cmd_buffer, count, 1, 1);
+ /* Ensure that the query copy dispatch is complete before a potential vkCmdResetPool because
+ * there is an implicit execution dependency from each such query command to all query commands
+ * previously submitted to the same queue.
+ */
+ cmd_buffer->active_query_flush_bits |=
+ RADV_CMD_FLAG_CS_PARTIAL_FLUSH | RADV_CMD_FLAG_INV_L2 | RADV_CMD_FLAG_INV_VCACHE;
+
/* Restore conditional rendering. */
cmd_buffer->state.predicating = old_predicating;
More information about the mesa-commit
mailing list