-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Editor crashes on minimising. #77790
Comments
I can reproduce it in 4.0.3-rc1, but 4.0.2.stable can't. Windows 10.0.19044 integrated AMD Radeon(TM) Vega 8 Graphics (31.0.14051.5006) - AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx (8 Threads) |
On my system it crashes consistently every single time in VULKAN mode, but you're right, it doesn't occur in OpenGL compatibility mode. |
This issue was introduced in 253b487 . I tested with that commit, where Win+M crashes the program, and with the one before it, where Win+M doesn't crash. The problem occurs inside the Error VulkanContext::prepare_buffers() function. When minimizing the editor, the |
@jpcerrone If we call The problem appears to come from this branch which does an early out from godot/drivers/vulkan/vulkan_context.cpp Lines 1818 to 1822 in 577ab3c
It looks like our old behaviour was to just keep a reference to the old swapchain image in the case of minimization. Taking a look around it seems the common solution is just to pause rendering in such cases and then not recreate the swapchain until the window is back (SaschaWillems/Vulkan@1f42dbd, https://vulkan-tutorial.com/Drawing_a_triangle/Swap_chain_recreation#page_Handling-minimization) Perhaps to keep things simple we can just only call |
That makes sense, I see why we can't call I tried only calling the Maybe we could modify the early out from } else if (err == VK_SUBOPTIMAL_KHR) {
// 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.");
// Updating the swap chain can fail if done during a window minimization. In that case, don't generate the next swapchain image.
Error update_swap_chain_res = _update_swap_chain(w);
if (update_swap_chain_res == ERROR_CODE_TO_CHECK){
break;
}
} |
Hmmm, maybe. But by the time the check happens, we will have already deleted the old swapchain. |
If the window hasn't been minimized the swapchain will have been re-generated by the time the check happens. |
My concern was more about the fact that if we return then break Edit: spending more time with the code, it looks like your initial idea is correct. We can just break after calling |
Hmmmm, with "initial idea" do you mean this?: _update_swap_chain(w);
break; Or checking for an error code like I mentioned in the last message?: Error update_swap_chain_res = _update_swap_chain(w);
if (update_swap_chain_res == ERROR_CODE_TO_CHECK){
break;
} If we go with the first one. Wouldn't we be discarding the new swapchain in the case of the window not minimizing? If we break we won't be calliing |
I meant:
I misunderstood what |
Ohh ok! I wasn't fully aware of how |
Fixes godotengine#77790 Adds missing 'break' statement to 'VulkanContext::prepare_buffers' function. It was mistakenly removed in godotengine#72859 (cherry picked from commit bd786ce)
Godot version
v4.0.3.stable.official [5222a99]
System information
Windows 11, AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz
Issue description
The editor crashes when it is minimised if it isn't the foreground window, eg. via Windows key + M. This didn't occur in 4.0.2, but is now occurring in 4.0.3. I'll just mention that /interface/editor/save_on_focus_loss is false because another issue mentions something like this but with that property set to true.
Steps to reproduce
N/A
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: