Repository navigation
fix(agc): keep a replaced Vulkan device alive - #59
Merged
boykopovar merged 1 commit intoSep 28, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
This was referenced Oct 7, 2026
Closed
9 tasks done
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.
What
The driver starts with a headless Vulkan device and replaces it with a windowed one at the first flip. The old device was destroyed as soon as the replacement was made. At that point, objects created from it (102 of them in a retail title, mostly device memory) were still referenced by caches. Destroying a device with live child objects is invalid (validation reports
VUID-vkDestroyDevice-device-05137), and the title later crashed inside the NVIDIA driver.How
In the presenter path, after
PrepareForReplacement()(which flushes cached textures, publishes shadows and waits for idle), the old device is kept in a function-local static list instead of being released. Its child objects stay valid for as long as anything still refers to them. The cost is one idle device for the life of the process; the replacement happens once, at the first flip.Testing
No automated test: the replacement only happens when a window is attached at the first flip, and
agc_driver_flipalready hangs onmain. All other CTest tests pass (agc_driverandagc_driver_pm4fail as onmain).