diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-07-09 12:24:07 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-07-09 12:24:07 +0200 |
commit | 1453dc9d5dea8934f26d157b78aa8ed3b7a8a500 (patch) | |
tree | 33ec6c99b90260d22c7ed57b4bc87c2c7335f885 /drivers/vulkan | |
parent | 83cc5d4914a6bff76069ac19191192337e4df3de (diff) | |
parent | df021b5063897eb4fe4a716aefc7096209ed29c6 (diff) | |
download | redot-engine-1453dc9d5dea8934f26d157b78aa8ed3b7a8a500.tar.gz |
Merge pull request #79143 from clayjohn/wayland-menu
Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain
Diffstat (limited to 'drivers/vulkan')
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 3feed2b109..7c52447e44 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1818,7 +1818,7 @@ Error VulkanContext::_update_swap_chain(Window *window) { if (window->width == 0 || window->height == 0) { free(presentModes); // Likely window minimized, no swapchain created. - return OK; + return ERR_SKIP; } // The FIFO present mode is guaranteed by the spec to be supported // and to have no tearing. It's a great default present mode to use. @@ -2275,8 +2275,10 @@ Error VulkanContext::prepare_buffers() { // Swapchain is not as optimal as it could be, but the platform's // presentation engine will still present the image correctly. print_verbose("Vulkan: Early suboptimal swapchain, recreating."); - _update_swap_chain(w); - break; + Error swap_chain_err = _update_swap_chain(w); + if (swap_chain_err == ERR_SKIP) { + break; + } } else if (err != VK_SUCCESS) { ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully. Error code: " + String(string_VkResult(err))); } else { |