In case execbuf failed it would block execution until the maximum
timeout if DEBUG_SYNC is enabled.
While at it also removing the shadowing of result that would cause
the function result to not have its values updated in case
vk_sync_wait() returns a error.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18110>
if (ret)
result = vk_queue_set_lost(&queue->vk, "execbuf2 failed: %m");
- if (queue->sync) {
- VkResult result = vk_sync_wait(&device->vk,
- queue->sync, 0,
- VK_SYNC_WAIT_COMPLETE,
- UINT64_MAX);
+ if (result == VK_SUCCESS && queue->sync) {
+ result = vk_sync_wait(&device->vk, queue->sync, 0,
+ VK_SYNC_WAIT_COMPLETE, UINT64_MAX);
if (result != VK_SUCCESS)
result = vk_queue_set_lost(&queue->vk, "sync wait failed");
}