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

Author: Mary Guillemard <[email protected]>
Date:   Fri Nov  3 12:23:25 2023 +0100

venus: skip bind sparse info when checking for feedback query

Fix an assertion when using vkQueueBindSparse.

Fixes: 7fbf608f2da ("venus: append query feedback at submission time")
Signed-off-by: Mary Guillemard <[email protected]>
Reviewed-by: Juston Li <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26027>

---

 src/virtio/vulkan/vn_queue.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/virtio/vulkan/vn_queue.c b/src/virtio/vulkan/vn_queue.c
index fd1ad4e23ae..57c0670f24e 100644
--- a/src/virtio/vulkan/vn_queue.c
+++ b/src/virtio/vulkan/vn_queue.c
@@ -270,12 +270,15 @@ vn_queue_submission_count_batch_feedback(struct 
vn_queue_submission *submit,
    }
 
    bool batch_has_feedback_query = false;
-   uint32_t cmd_count = vn_get_cmd_buffer_count(submit, batch_index);
-   for (uint32_t i = 0; i < cmd_count; i++) {
-      struct vn_command_buffer *cmd = vn_command_buffer_from_handle(
-         vn_get_cmd_handle(submit, batch_index, i));
-      if (!list_is_empty(&cmd->builder.query_batches))
-         batch_has_feedback_query = true;
+
+   if (submit->batch_type != VK_STRUCTURE_TYPE_BIND_SPARSE_INFO) {
+      uint32_t cmd_count = vn_get_cmd_buffer_count(submit, batch_index);
+      for (uint32_t i = 0; i < cmd_count; i++) {
+         struct vn_command_buffer *cmd = vn_command_buffer_from_handle(
+            vn_get_cmd_handle(submit, batch_index, i));
+         if (!list_is_empty(&cmd->builder.query_batches))
+            batch_has_feedback_query = true;
+      }
    }
 
    if (batch_has_feedback_query)

Reply via email to