Mesa (main): radv: Only wait on CS/PS to finish if we wait on a semaphore.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 12 00:08:43 UTC 2022


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

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sat Feb  5 22:40:07 2022 +0100

radv: Only wait on CS/PS to finish if we wait on a semaphore.

I think plain submission doesn't need it.

Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14574>

---

 src/amd/vulkan/radv_device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 8c61bd924d0..d7baf343208 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -4392,8 +4392,11 @@ radv_queue_submit(struct vk_queue *vqueue, struct vk_queue_submit *submission)
       }
 
       for (uint32_t j = 0; j < submission->command_buffer_count; j += advance) {
+         /* For fences on the same queue/vm amdgpu doesn't wait till all processing is finished
+          * before starting the next cmdbuffer, so we need to do it here. */
+         bool need_wait = !j && submission->wait_count > 0;
          struct radeon_cmdbuf *initial_preamble =
-            !j ? initial_flush_preamble_cs : initial_preamble_cs;
+            need_wait ? initial_flush_preamble_cs : initial_preamble_cs;
          advance = MIN2(max_cs_submission, submission->command_buffer_count - j);
          bool last_submit = j + advance == submission->command_buffer_count;
 



More information about the mesa-commit mailing list