rendervulkan: ensure queue is idle before swapchain recreation
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 Co-authored-by: Erik Kurzinger <ekurzinger@nvidia.com>
This commit is contained in:
parent
ae73dd1ce0
commit
af3f6bf827
2 changed files with 2 additions and 0 deletions
|
@ -2694,6 +2694,7 @@ bool vulkan_remake_swapchain( void )
|
|||
{
|
||||
VulkanOutput_t *pOutput = &g_output;
|
||||
g_device.waitIdle();
|
||||
g_device.vk.QueueWaitIdle( g_device.queue() );
|
||||
|
||||
pOutput->outputImages.clear();
|
||||
|
||||
|
|
|
@ -647,6 +647,7 @@ static inline uint32_t div_roundup(uint32_t x, uint32_t y)
|
|||
VK_FUNC(MapMemory) \
|
||||
VK_FUNC(QueuePresentKHR) \
|
||||
VK_FUNC(QueueSubmit) \
|
||||
VK_FUNC(QueueWaitIdle) \
|
||||
VK_FUNC(ResetCommandBuffer) \
|
||||
VK_FUNC(ResetFences) \
|
||||
VK_FUNC(UnmapMemory) \
|
||||
|
|
Loading…
Reference in a new issue