fix: add device_wait_idle when destroying swapchain #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
this PR is more like a request for comments than an a proper actual fix.
I noticed on Mac OSX, some of the examples may crash when their windows is being resized. The example
eguiseems particularly prone to that issue.the debugger shows that the segfault always happens in the following function:
I found this issue on MoltenVK's repo: KhronosGroup/MoltenVK#2031
which seems to imply that
vkDeviceWaitIdle()should be called when a resize is being detected.Therefore, I added a call to
device.device_wait_idle()just before destroying the old swap_chain, and that seems quite successful on my side so far.Another thing, perhaps related:
some of the examples are flickering quite a bit when their window is being resized:
font_bmpimage_samplerOnce I added that call to
device_wait_idle, the amount of flickering got reduced, but unfortunately is still happening. So perhaps this is not the right fix or there is something else happening.