fix(agc): invalidate stale MSAA targets and read guards after guest memory remapping #5462

Closed
squirlyfoxy wants to merge 2 commits from upstream-pr/5462 into main
squirlyfoxy commented 2026-10-13 20:18:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by squirlyfoxy on 2026-10-13T20:18:39Z.


What

Fix stale MSAA targets and read guards surviving guest memory remapping. Reusing an address for a new allocation could incorrectly reject reads and abort the game.

Track mapping identity across protection changes, invalidate targets after remapping, and retain retired GPU resources until recorded commands complete. Framebuffer caching also checks target ownership.

Tested

Windows 11, NVIDIA GeForce RTX 2060:

  • Full system libraries build passed.
  • MSAA guest access tests passed, including partial/full remapping, protection changes, and resource retirement.
  • Graphics validation tests passed.
  • Pipeline cache and retained lifetime tests passed.
  • Conventions check passed on the corrected changes.
  • My Friend Peppa Pig (PPSA03706, 01.000.002): ran past the previous MSAA read-guard crash. Full gameplay verified.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source — no new dependencies
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA03706 — My Friend Peppa Pig;
  • GPUs tested: NVIDIA GeForce RTX 2060, driver 610.47, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848955804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5462). Originally posted by [squirlyfoxy](https://github.com/squirlyfoxy) on 2026-10-13T20:18:39Z. --- ### What Fix stale MSAA targets and read guards surviving guest memory remapping. Reusing an address for a new allocation could incorrectly reject reads and abort the game. Track mapping identity across protection changes, invalidate targets after remapping, and retain retired GPU resources until recorded commands complete. Framebuffer caching also checks target ownership. ### Tested Windows 11, NVIDIA GeForce RTX 2060: - Full system libraries build passed. - MSAA guest access tests passed, including partial/full remapping, protection changes, and resource retirement. - Graphics validation tests passed. - Pipeline cache and retained lifetime tests passed. - Conventions check passed on the corrected changes. - My Friend Peppa Pig (PPSA03706, 01.000.002): ran past the previous MSAA read-guard crash. Full gameplay verified. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source — no new dependencies - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA03706 — My Friend Peppa Pig; - [x] GPUs tested: NVIDIA GeForce RTX 2060, driver 610.47, Windows 11 - [x] AI-assisted: yes
squirlyfoxy commented 2026-10-13 21:47:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by squirlyfoxy on 2026-10-13T21:47:10Z.


Closing as fixed by #4474

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155884183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5462#issuecomment-6155884183). Originally posted by [squirlyfoxy](https://github.com/squirlyfoxy) on 2026-10-13T21:47:10Z. --- Closing as fixed by #4474

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5462
No description provided.