On Wed, 4 May 2022 at 15:36, Jan Sikorski <wine(a)gitlab.winehq.org> wrote:
@@ -1838,10 +1846,17 @@ void wined3d_context_vk_wait_command_buffer(struct wined3d_context_vk *context_v if (context_vk->submitted.buffers[i].id != id) continue;
- VK_CALL(vkWaitForFences(device_vk->vk_device, 1, - &context_vk->submitted.buffers[i].vk_fence, VK_TRUE, UINT64_MAX)); - wined3d_context_vk_cleanup_resources(context_vk); - return; + vk_fence = context_vk->submitted.buffers[i].vk_fence; + wined3d_context_vk_cleanup_resources(context_vk, vk_fence); + for (i = 0; i < context_vk->submitted.buffer_count; ++i) + { + if (context_vk->submitted.buffers[i].id != id) + continue; + + VK_CALL(vkWaitForFences(device_vk->vk_device, 1, &vk_fence, VK_TRUE, UINT64_MAX)); + wined3d_context_vk_remove_command_buffer(context_vk, i); + return; + } }
I suppose that works, although I think the double loop look a little awkward. It might be worth introducing a helper to lookup a command buffer by ID to avoid that at some point.