Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rendervulkan: ensure queue is idle before swapchain recreation #944

Closed
wants to merge 1 commit into from

Conversation

erik-kz
Copy link

@erik-kz erik-kz commented Sep 12, 2023

The CVulkanDevice::waitIdle call at the beginning of vulkan_remake_swapchain only waits for the most recently submitted command buffer to complete. This is inadequate because it does not wait for any additional commands which may have been submitted by the driver during vkQueuePresentKHR. Such commands could reference resources associated with the old swapchain, so it is not safe to destroy it until they are also complete.

To fix the issue, instead of calling CVulkanDevice::waitIdle, vulkan_remake_swapchain will call vkQueueWaitIdle.

Fixes: #945

The CVulkanDevice::waitIdle call at the beginning of
vulkan_remake_swapchain only waits for the most recently submitted
command buffer to complete. This is inadequate because it does not wait
for any additional commands which may have been submitted by the driver
during vkQueuePresentKHR.  Such commands could reference resources
associated with the old swapchain, so it is not safe to destroy it until
they are also complete.

To fix the issue, instead of calling CVulkanDevice::waitIdle,
vulkan_remake_swapchain will call vkQueueWaitIdle.

Fixes: ValveSoftware#945
@misyltoad
Copy link
Collaborator

Merged manually to keep the cmdbuf reset behaviour.

@misyltoad misyltoad closed this Sep 14, 2023
@misyltoad
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hang after resizing window with NVIDIA driver
2 participants