anv: only signal wsi fence BO on last command buffer

I'm pretty sure this doesn't fix anything because the WSI code only
use a single VkSubmitInfo, but better be safe.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ccb7d606f1 ("anv: Use submit-time implicit sync instead of allocate-time")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8934>
(cherry picked from commit 64cb03a52d)
This commit is contained in:
Lionel Landwerlin 2020-12-06 23:22:45 +02:00 committed by Dylan Baker
parent a6dd1fda4e
commit a7abc65a58
2 changed files with 5 additions and 3 deletions

View file

@ -868,7 +868,7 @@
"description": "anv: only signal wsi fence BO on last command buffer",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "ccb7d606f1a2939d5a784f1ec491cffc62e8f814"
},

View file

@ -1266,7 +1266,8 @@ VkResult anv_QueueSubmit(
num_in_semaphores = pSubmits[i].waitSemaphoreCount;
}
if (j == pSubmits[i].commandBufferCount - 1) {
const bool is_last_cmd_buffer = j == pSubmits[i].commandBufferCount - 1;
if (is_last_cmd_buffer) {
/* Only the last batch gets the out semaphores */
out_semaphores = pSubmits[i].pSignalSemaphores;
out_values = signal_values;
@ -1276,7 +1277,8 @@ VkResult anv_QueueSubmit(
result = anv_queue_submit(queue, cmd_buffer,
in_semaphores, in_values, num_in_semaphores,
out_semaphores, out_values, num_out_semaphores,
wsi_signal_bo, execbuf_fence,
is_last_cmd_buffer ? wsi_signal_bo : NULL,
execbuf_fence,
perf_info ? perf_info->counterPassIndex : 0);
if (result != VK_SUCCESS)
goto out;