Fix Vulkan crash with TextureChange::Modified #155
Merged
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.
The
TextureChange::Removed
andTextureChange::Modified
match arms inYakuiVulkan::update_textures
both have logic to remove a texture, but the logic is inconsistent between the two arms. This PR changes theTextureChange::Modified
branch to be consistent withTextureChange::Removed
.This change also fixes a crash I experienced when trying to change UI text based on in-game information on a game that has a graphics pipeline depth (simultaneous frames in flight) of 2. The following Vulkan validation error appeared during this crash:
Validation Error: [ VUID-vkDestroyImage-image-01000 ] | MessageID = 0xf2d29b5a | vkDestroyImage(): can't be called on VkImage 0xe3343f000000028f[] that is currently in use by VkCommandBuffer 0x20919128700[frame]. The Vulkan spec states: All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution (https://vulkan.lunarg.com/doc/view/1.3.280.0/windows/1.3-extensions/vkspec.html#VUID-vkDestroyImage-image-01000) id=VUID-vkDestroyImage-image-01000 number=-221078694 queue_labels= cmd_labels= objects=
Setting a breakpoint on the validation error did point me to the
TextureChange::Modified
match arm.I am still relatively inexperienced in Vulkan, so I'm not certain this fix is correct nor would I be confident in setting up some kind of test case to be able to reproduce the issue in this repo itself. For extra context, I encountered this issue in Ralith/hypermine#391.