fix(agc): keep a replaced Vulkan device alive #59
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/59"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-09-28T03:47:40Z.
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).