Repository navigation
fix(vulkan): reuse unchanged swapchains across rebuilds and game joins - #156
Merged
Merged
Conversation
NVIDIA with PRIME on X11 blocks ~22 s in every swapchain destroy or retiring create, and Roblox rebuilds an identical swapchain after each view change and on every join. Identical creates now get the current or last destroyed swapchain back, and a surface the game destroys stays alive until no swapchain uses it.
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.
On NVIDIA with PRIME on X11, every swapchain destroy or retiring create blocks Roblox's main thread for about 22 s, so each game join froze for about 44 s. Moving the destroy to the background (#148/#151) didn't help because the create itself blocks.
Roblox rebuilds an identical swapchain after each view change, and on every join it destroys the swapchain and surface, then makes the same swapchain again on a new surface. Now:
Tested on Wayland (RTX 4090): three joins in a row reused the kept swapchain with no driver create or destroy, and the join to swapchain-ready time was about 50–75 ms. On X11, real resizes still made new swapchains. The unit tests and full suite pass. Not tested on an actual PRIME laptop, AMD, Intel or
vr.