Repository navigation
fix(agc): release the current address space with the image mirrors - #1071
Merged
adriadam10 merged 1 commit intoOct 8, 2026
Merged
Conversation
LeandroLP23
force-pushed
the
fix/agc-address-space-cache-exit
branch
from
October 7, 2026 08:53
2b7f71b to
b11d62c
Compare
ClearImageMirrors drops the mirror map before the device is destroyed, but the current address space in Spaces() still held its mirrors, so they were freed by the cache's static destructor from the driver's DLL detach, after the Vulkan driver was unloaded, and every exit crashed on Windows. The teardown now releases the current address space too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LeandroLP23
force-pushed
the
fix/agc-address-space-cache-exit
branch
from
October 7, 2026 08:53
b11d62c to
db26339
Compare
9 tasks done
Collaborator
|
Checked the diff: |
This was referenced Oct 8, 2026
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
Closing a title on Windows crashes after #849: its
ClearImageMirrorsdrops the mirror map before the device is destroyed, but the current address space inSpaces()(GuestBufferMemory.cpp) still holds shared references to the same mirrors. They live on until the cache's function-local static is destroyed fromlibSceAgcDriver.prx's DLL detach, and their pooled buffers are then freed through Vulkan after the Vulkan driver has been unloaded:Stack, symbolized against the build's
libSceAgcDriver.prx:Buffer::~Buffer()(fromBuffer::release())BufferPool::~BufferPool()_Sp_counted_ptr_inplace<ImageMirror>::_M_dispose()_Sp_counted_ptr_inplace<GuestBufferMemory::AddressSpace>::_M_dispose()__tcf_...Spaces()::cache(static destructor)_CRT_INIT,DllMainCRTStartupClearImageMirrorsnow also releases the current address space, so its mirrors are freed in the device teardown with the rest, while the device exists. The next use rebuilds the address space, as after the existing waiter drop.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release with
BUILD_TESTING=ON, AMD Radeon 860M (RDNA 3.5, driver 32.0.13058.8001),main219a1cf.DOOM Shareware homebrew PPSA99666 01.001.000 (lowbit/ps5-doom v1.1.0, the build in #690), converted with
--windows, closed with the window's close button:mainctest: 382/383 passed; the failure is agc_driver_vopc_compare_table fails in wave32 for LG compares in the e32 encoding on AMD RDNA 3.5 #825, which also fails on unmodifiedmainon this GPU.GuestBufferMemory.cpp(feat(agc): host import windows, least-recent eviction under the budget #290, GTA V: the prologue plays (testing branch of the PRs it needs) #426, perf(agc): baseline shader recompilation on registration #639, feat(agc): import shared direct memory through udmabuf on Linux #943, fix(agc): compare host imports when device writes reach the write watch #1046, fix(agc): skip Linux host imports of ranges not mapped read-write #1051) conflicts with this change; perf(agc): baseline shader recompilation on registration #639 callsSpaces()without changing it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code