fix(agc): retire host imports of ranges mapped again #1235
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1235"
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 CnRJay on 2026-10-07T18:56:37Z.
What
refreshImportsandimportAllocationkeep a host import whenever the registry still holds a range with the same base and size. A fixed remap into a registered range (RemapFixedIntoRegistered) replaces the registry range at the same base and size, so the old import survives. The GPU then keeps reading the pages it pinned, or the alias view it mapped, before the remap. The CPU sees the new memory.HostImportkeeps aweak_ptrto the registryRangeit was made from. Ashared_ptrwould be a lease, and the remap would wait for it forever.owner_beforecomparison, so a freed and reallocated range cannot alias). Otherwise it is retired and made again.APS5_TRACE_HOST_IMPORTlogsretired: the range was mapped again.Registry ranges are only replaced by add, unmap and protect mutations of that range, so imports of untouched ranges are unaffected.
Interaction with #290: its
refreshImportskeeps an import while any containing range exists. With import windows, the identity to compare would be the containing range's.Tested
Windows 11, MinGW, NVIDIA RTX (Vulkan).
APS5_NO_HOST_IMPORT=1also fixed the load, which isolated the import. With this change (and a CMASK fast-clear model as in #1072) the EA SPORTS splash renders.remappedImportTestsinagc_driver_recorder_tests: remove and re-add a registered block at the same base and size, then require a new import serial. It fails onmainwiththe import of a range mapped again was keptand passes with the change. The rest of the binary passes too.ctest: 395 of 395 pass.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
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T21:35:52Z.
Thanks, the cause and the test are clear. This is being tested now, together with #1237.
Because a whole-range protect also replaces the
Rangeobject (replaceRangeinGuestAllocations.cpp), a title that re-protects whole registered ranges will now re-import them each time. The testing compares host-import creations and retirements withmainunderAPS5_TRACE_HOST_IMPORT, to check that this doesn't become a re-import storm.This conflicts with #290 in
GuestBufferMemory.cpp, so whichever merges second needs a rebase. I'll post the results here.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T01:02:13Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL326-330, L355, L475-477core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL326-330, L355, L475-477core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL326-330, L355, L475-477