mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
The driver keeps the replaced headless VulkanDevice alive next to the windowed one, so a process holds two Graphics::PipelineCache objects for the same vk-pipelines-*.bin. Each saved its own VkPipelineCache over the whole file, periodically and at teardown, so the last writer dropped the other object's pipelines and those of earlier runs. A save now reads the file under a per-path mutex, validates it as the load does, creates a temporary cache from it and merges this object's cache into that temporary one, then writes the result atomically. Merging into the temporary cache keeps the live cache free of the external synchronisation vkMergePipelineCaches requires of its destination. A merge that adds nothing leaves the file as it is, an unreadable file is not written over, and a result smaller than the file on disk or the data loaded at start is not written; an invalid file or one the driver refuses is replaced. Co-Authored-By: Claude Opus 5.5 <[email protected]>