Fix incorrect handling of VkResult in swapchain creation#798
Open
DissolveDZ wants to merge 1 commit intoxCollateral:devfrom
Open
Fix incorrect handling of VkResult in swapchain creation#798DissolveDZ wants to merge 1 commit intoxCollateral:devfrom
DissolveDZ wants to merge 1 commit intoxCollateral:devfrom
Conversation
Fix incorrect handling of VkResult
Contributor
|
lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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,
I ran into some problems running this mod on my wayland linux setup and after some investigation it turned out the error handling of VkResult is incorrect.
Basically in Vulkan.java the checkResult function:
should be changed to
Fixes:
#791
#724
#708
This prevents fatal crashes on many linux setups. VkResult codes like VK_SUBOPTIMAL_KHR or VK_TIMEOUT should NOT be treated as fatal according to the vulkan spec.
Fatal errors return negative values, while non-fatal errors return positive values.
Ref:
https://docs.vulkan.org/refpages/latest/refpages/source/vkCreateSwapchainKHR.html
https://docs.vulkan.org/refpages/latest/refpages/source/VkResult.html
Tested on multiple setups, this is the correct behavior and "fixes" non-fatal errors being treated as crashes.
Errors like temporary out of date errors will resolve without crashing (e.g. resizing a window, losing window focus, etc.).