-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Vulkan back-end crashes on Linux when I try to maximize/resize window #2626
Comments
Could either be a problem with the Vulkan back-end, either a problem with your Linux setup/driver.
|
|
The problem is vulkan examples don't handle |
Hello, Testing with the last changes did not work. And because the proc load was too high, I added an SDL_Delay(16) at the end of the main loop. Curiously, it was possible to resize the window without the boring instant crash. After some tests, after 2 or 3tries,I got no crash, and SDL_Delay(17), means any value > 16 works well. Looks like some race condition with SDL resize window event or something like that ? My machine : Linux / Intel x86_64, SDL2 2.0.9 + vulkan The change,for the one interested to test is a one liner
Last but not least, I got the same instant crash when resizing the GLFW + vullkan window. I don't know well GLFW API, but couldn't this be the same timing issue ? HTH EDIT: added missing information :
Other helpful information : [EDIT] : SDL_Delay of 16 ms does not work every time. After some tries, 17 gives better results (20 always works) |
Little update : Using -DIMGUI_UNLIMITED_FRAME_RATE at build time + SDL_Delay(5) gives ~ 178 fps, and SDL_Delay(3) produces ~ 280 fps (using metrics in the demo), while SDL_Delay(2) gave me somecrashes. Perfect for my needs. Looks like it works better (I was not able to make it crash again with SDL_Delay values > 2) :-) Can someone confirm there is no more crash ? The changes :
|
@ebachard As I said, that crash comes from incorrect usage of Vulkan API in renderer code. Your workaround might work for some people, but broken codes are still broken after all. |
@mocabe : I never said it was the solution. My urgent need is to test Vulkan API with my software, without crash every time I move or resize the window. Since I'm curious to fix it correctly, be sure I'll continue to learn Vulkan API and make some tries from time to time ;-) |
This is not only limitted to the sdl backend, it also hits the glfw backend. |
And see https://vulkan-tutorial.com/Drawing_a_triangle/Swap_chain_recreation for handling. |
I have a raw X11 & Vulkan impl up for review #3372 . It handles window resizing properly. The current imgui example implementations for vulkan don't handle resized windows well. The best place to handle vulkan surface resizing is presenting the current swapchain to the surface and checking for vk_err_out_of_date. If you try and do it elsewhere, like responding to a window resize event, there's the possibility that it becomes out of date again from responding to that event to the next frame render loop by further resizing. This happens quite a bit when using an x11 compositor as they usually try to redraw the surface as the window resizes to make it look nicer. |
Similar? Probably way different (since this issue is so old)
|
I believe this should now be fixed, see this comment: Given the complexity of this and how it has been stretched over a long time (with other Vulkan changes), I would appreciate if everyone affected could confirm that it fixes the situation for them. Thanks everyone! If there is an issue please comment and we can reopen issues. |
My Issue/Question:
Imgui crashes when I try to maximize/resize window:
Standalone, minimal, complete and verifiable example: (see #2261)
See
example_sdl_vulkan
.The text was updated successfully, but these errors were encountered: