fix(agc): a replaced device's unit shadows leave the registry #373

Merged
MichonGoddijn231849 merged 1 commit from upstream-pr/373 into main 2026-10-04 05:49:42 +00:00
MichonGoddijn231849 commented 2026-10-02 16:15:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-02T16:15:34Z.


What

At the first present, the windowless device is replaced by one with a window. PrepareForReplacement published the replaced device's unit shadows, but they stayed registered.

  • UnitShadow's lookups take the shadow whose import starts nearest below an address. A stale entry of the old device there hid the live import's shadow.
  • AnyShadowedOverlaps then reported nothing, and an upload detiled the import's stale bytes instead of the shadowed write-back results.
  • The replaced device's shadows are now dropped (DestroyShadows) once it is idle and they have been published.

In GTA V this made a cube map read stale bytes, although its six faces had just been rendered and written back.

Related: #284 frees the replaced device's host imports. This PR drops its unit shadows. The two touch different code and work independently.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • GTA V (PPSA04264): the reflection cube's storage image takes its faces' results. Before, it kept the bytes the memory held at load.
  • Dreaming Sarah (PPSA02929): the title menu, its text and the first scene render as on main.
  • Demon's Souls (PPSA01342), with #231 and #232: it reaches the main menu.
  • ctest: all tests pass.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4718734982 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/373). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-02T16:15:34Z. --- ### What At the first present, the windowless device is replaced by one with a window. `PrepareForReplacement` published the replaced device's unit shadows, but they stayed registered. - `UnitShadow`'s lookups take the shadow whose import starts nearest below an address. A stale entry of the old device there hid the live import's shadow. - `AnyShadowedOverlaps` then reported nothing, and an upload detiled the import's stale bytes instead of the shadowed write-back results. - The replaced device's shadows are now dropped (`DestroyShadows`) once it is idle and they have been published. In GTA V this made a cube map read stale bytes, although its six faces had just been rendered and written back. Related: #284 frees the replaced device's host imports. This PR drops its unit shadows. The two touch different code and work independently. ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0. - GTA V (PPSA04264): the reflection cube's storage image takes its faces' results. Before, it kept the bytes the memory held at load. - Dreaming Sarah (PPSA02929): the title menu, its text and the first scene render as on `main`. - Demon's Souls (PPSA01342), with #231 and #232: it reaches the main menu. - `ctest`: all tests pass. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!373
No description provided.