-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix for vulkan_create_swapchain() not clearing flag (fixes random crashes with fast forwarding) #18295
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
Open
ro8inmorgan
wants to merge
7
commits into
libretro:master
Choose a base branch
from
ro8inmorgan:vulkan_crash_fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3
−1
Open
Fix for vulkan_create_swapchain() not clearing flag (fixes random crashes with fast forwarding) #18295
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
05670b6
improved vulkan_create_swapchain() to handle swapchain creation bette…
ro8inmorgan fb36ee8
As requested by PR review, reverted back to original create_swapchain…
ro8inmorgan 31da357
fixed oepsie with copy paste
ro8inmorgan 48ca71e
fixed oepsie with copy paste
ro8inmorgan 960e1ad
Fixed random crash on Android when destroying old swapchain before ne…
ro8inmorgan c3540fd
Restored all my initial changes without all the reformatting of the c…
ro8inmorgan f88ebf6
The VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN should be cleared otherwise ev…
ro8inmorgan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this helps, it might point to bugs elsewhere, but alone, this looks very wrong. I'm no longer familiar with this code, but further up there's stuff like:
If that code path is reached without a new swapchain having been created that seems like it should not be possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the code figures out there is no need to recreate it's already clearing that flag.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats actually not true, there are paths in this function that will return true without ever clearing the flag. This function is a one off so it should always be cleared after creation is success. Could you ellaborate on why it looks "very wrong"? Because IMO it should always be cleared before the function ends.
The flag is set at line 1960 with
vk->flags |= VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN;
and it def could reach the last return true without ever clearing the flag even tho its succesfull. In fact I actually see another path now in this function at line 2220 that doesn't clear the flag either, which could cause the same issue.
Leaving this flag set it will life beyond this function and can cause false positive on new swapchains being created. I personally feel nog clearing this flag here is the bug.
I searched issues here on github and I am definitly not the only one having the same problem specific with Vulkan.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the problem, it isn't. There are atleast 2 paths where its creating it but not clearing the flag.