fix(agc): retire an undrawn filled multisampled color target that a guest access overlaps #9186

Merged
fma-rc merged 5 commits from upstream-pr/9186 into main 2026-10-25 13:25:08 +00:00
fma-rc commented 2026-10-21 14:43:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-21T14:43:00Z.


What

A multisampled texture that a shader reads before any draw rendered to it becomes a multisampled target filled from its guest memory, and that memory is guarded like a drawn target's: the next guest access to it throws overlaps multisampled color target ... whose samples are only on the host: guest access to it is not implemented. Death Stranding 2 (PPSA02015) stops there on both GPUs, at a compute shader's storage image access over such a texture:

compute shader 0xc280079300: AGC graphics: a storage image access of 0xc2e9b40000+0x870000 overlaps multisampled color target 0xc2e9b40000+0x1fe0000 (4 samples), whose samples are only on the host: guest access to it is not implemented

The samples of such a target are still the memory's bytes, so nothing is lost by dropping it. Each target now carries a flag for whether its samples exist only on the host. A drawn target, a recreated one, one a dispatch's storage view writes and one that absorbs a color fill set it; a target filled for sampling starts without it. A guest access over a target without the flag retires it the way an unmap does and goes on; it is rebuilt from guest memory at its next use. A target with the flag throws as before. The debt entry for multisampled color targets records the rule.

#8223 also retires multisampled targets on guest access, when the CPU wrote over a target's memory since the last draw. That does not cover this case: the shader access comes from the GPU with no CPU write in between, and DS2 stops at the same line with #8223 applied. The two change the same function and conflict; I merged them for the DS2 run below (each target keeps both #8223's write stamp and this flag), and with both, the test's #8223 cases and the new ones pass together on the RTX 5080. Whichever lands second takes the merged version; this PR depends on #8223 and I rebase it onto main once #8223 is in.

Tested

Arch Linux, rebased on main b7a451d62b.

  • agc_driver_sample_multisample_target has new cases: a 4x texture sampled before any draw is retired by a guest access, and a later load reads the memory's new value; a guest access over a drawn target is still refused; one over an undrawn texture a dispatch wrote, or one that absorbed a fill, is still refused, and the absorbed fill's value is kept. With main's MultisampleTarget.cpp the test fails on the RTX 5080, the Radeon 610M and lavapipe at the first new case (a storage image access ... overlaps multisampled color target ...); with the change it passes on all three.
  • Death Stranding 2, hidden, on main with PR 5426, PR 7978, PR 6565, PR 6182, #8223 and #9183 (needed to reach this shader): without this change the RTX 5080 stops at the line above at 132 s and the 680M at 184 s; with it both run on to the next stop, color targets with fewer fragments than samples (EQAA) are unsupported (RTX 5080 at 93 s, frame 117; 680M at 157 s, frame 86, picture visible).
  • With VK_LAYER_KHRONOS_validation enabled, agc_driver_sample_multisample_target passes on the RTX 5080 with no validation messages, on the merge base and with the change.
  • In a Windows 11 VM (WinLibs GCC 15.2, no GPU) the PR builds and passes all 1928 tests.
  • tools/check_conventions.py --base origin/main passes.

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
  • Generic behaviour, not specific to one title
  • Depends on: #8223
  • Fixes: none
  • Unblocks: PPSA02015 #5424
  • GPUs tested: NVIDIA RTX 5080 (driver 615.78.08, Linux), AMD Radeon 610M and 680M (RADV, Mesa 26.1.4 / 26.2.4, Linux), lavapipe
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4953450283 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9186). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-21T14:43:00Z. --- ### What A multisampled texture that a shader reads before any draw rendered to it becomes a multisampled target filled from its guest memory, and that memory is guarded like a drawn target's: the next guest access to it throws `overlaps multisampled color target ... whose samples are only on the host: guest access to it is not implemented`. Death Stranding 2 (PPSA02015) stops there on both GPUs, at a compute shader's storage image access over such a texture: ``` compute shader 0xc280079300: AGC graphics: a storage image access of 0xc2e9b40000+0x870000 overlaps multisampled color target 0xc2e9b40000+0x1fe0000 (4 samples), whose samples are only on the host: guest access to it is not implemented ``` The samples of such a target are still the memory's bytes, so nothing is lost by dropping it. Each target now carries a flag for whether its samples exist only on the host. A drawn target, a recreated one, one a dispatch's storage view writes and one that absorbs a color fill set it; a target filled for sampling starts without it. A guest access over a target without the flag retires it the way an unmap does and goes on; it is rebuilt from guest memory at its next use. A target with the flag throws as before. The debt entry for multisampled color targets records the rule. #8223 also retires multisampled targets on guest access, when the CPU wrote over a target's memory since the last draw. That does not cover this case: the shader access comes from the GPU with no CPU write in between, and DS2 stops at the same line with #8223 applied. The two change the same function and conflict; I merged them for the DS2 run below (each target keeps both #8223's write stamp and this flag), and with both, the test's #8223 cases and the new ones pass together on the RTX 5080. Whichever lands second takes the merged version; this PR depends on #8223 and I rebase it onto `main` once #8223 is in. ### Tested Arch Linux, rebased on `main` b7a451d62b. - `agc_driver_sample_multisample_target` has new cases: a 4x texture sampled before any draw is retired by a guest access, and a later load reads the memory's new value; a guest access over a drawn target is still refused; one over an undrawn texture a dispatch wrote, or one that absorbed a fill, is still refused, and the absorbed fill's value is kept. With `main`'s `MultisampleTarget.cpp` the test fails on the RTX 5080, the Radeon 610M and lavapipe at the first new case (`a storage image access ... overlaps multisampled color target ...`); with the change it passes on all three. - Death Stranding 2, hidden, on `main` with PR 5426, PR 7978, PR 6565, PR 6182, #8223 and #9183 (needed to reach this shader): without this change the RTX 5080 stops at the line above at 132 s and the 680M at 184 s; with it both run on to the next stop, `color targets with fewer fragments than samples (EQAA) are unsupported` (RTX 5080 at 93 s, frame 117; 680M at 157 s, frame 86, picture visible). - With `VK_LAYER_KHRONOS_validation` enabled, `agc_driver_sample_multisample_target` passes on the RTX 5080 with no validation messages, on the merge base and with the change. - In a Windows 11 VM (WinLibs GCC 15.2, no GPU) the PR builds and passes all 1928 tests. - `tools/check_conventions.py --base origin/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 - [x] Generic behaviour, not specific to one title - [x] Depends on: #8223 - [x] Fixes: none - [x] Unblocks: PPSA02015 #5424 - [x] GPUs tested: NVIDIA RTX 5080 (driver 615.78.08, Linux), AMD Radeon 610M and 680M (RADV, Mesa 26.1.4 / 26.2.4, Linux), lavapipe - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 07:50:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T07:50:56Z.

Review: DISMISSED


The regression target and the change are scoped to the undrawn, guest-backed multisampled texture case, and the PR description contains useful A/B evidence. Its validation-layer report names the same 23 tests on main and the change, required environment variables, selected GPU, and states that neither run had a missing-layer warning or a VUID line. I could not independently reproduce GPU tests here: this environment has no /dev/dri device or Vulkan tools, and the hosted product jobs are skipped. Treat the detailed GPU results as author-reported evidence.

I need the branch coordination and base updated before this is merge-ready:

  • The PR discussion records agreement with #8223's author that #8223 lands first and this PR rebases onto it. The current checklist still says Depends on: none, and the overlap report confirms both PRs change MultisampleTarget.cpp and its retirement path. Please set Depends on: #8223 and rebase this combined change onto the agreed #8223 head after it lands (or coordinate a different order with that author and update both PRs). Keep the CPU-write/claim behavior and this PR's host-only behavior together, as in the combined test report.
  • This head is 1,198 commits behind current upstream main (3 commits ahead); the merge-tree is clean, but CONTRIBUTING requires branches to stay current. Please update it to current main, then refresh the overlap report and rerun conventions plus the focused validation-layer A/B suite on the rebased head.

The current hosted checks show conventions, eligibility, intake, labels and report passing; Linux, Windows and product-test jobs are skipped. My local current-main diff check and convention check pass, and the merge-tree is clean. I am requesting changes for the agreed dependency/base update, not for a failure in the reported GPU test results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5610871355 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9186#pullrequestreview-5610871355). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T07:50:56Z. **Review:** DISMISSED --- The regression target and the change are scoped to the undrawn, guest-backed multisampled texture case, and the PR description contains useful A/B evidence. Its validation-layer report names the same 23 tests on main and the change, required environment variables, selected GPU, and states that neither run had a missing-layer warning or a VUID line. I could not independently reproduce GPU tests here: this environment has no `/dev/dri` device or Vulkan tools, and the hosted product jobs are skipped. Treat the detailed GPU results as author-reported evidence. I need the branch coordination and base updated before this is merge-ready: - The PR discussion records agreement with #8223's author that #8223 lands first and this PR rebases onto it. The current checklist still says `Depends on: none`, and the overlap report confirms both PRs change `MultisampleTarget.cpp` and its retirement path. Please set `Depends on: #8223` and rebase this combined change onto the agreed #8223 head after it lands (or coordinate a different order with that author and update both PRs). Keep the CPU-write/claim behavior and this PR's host-only behavior together, as in the combined test report. - This head is 1,198 commits behind current upstream `main` (3 commits ahead); the merge-tree is clean, but CONTRIBUTING requires branches to stay current. Please update it to current `main`, then refresh the overlap report and rerun conventions plus the focused validation-layer A/B suite on the rebased head. The current hosted checks show conventions, eligibility, intake, labels and report passing; Linux, Windows and product-test jobs are skipped. My local current-main diff check and convention check pass, and the merge-tree is clean. I am requesting changes for the agreed dependency/base update, not for a failure in the reported GPU test results.
adriadam10 commented 2026-10-24 07:21:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T07:21:18Z.

Review: CHANGES_REQUESTED


@MarcZX10 both points of your review are addressed on the current head:

  • The body now says Depends on: #8223.
  • The branch is rebased onto current main (Linux build and ctest passed on the rebase, 971/971; MultisampleTargetStorageView from main is combined with this PR's host-only check).

Remaining: this PR rebases onto #8223 once that lands (it is still open and conflicting with main), keeping its CPU-write stamp together with the host-only flag. @MarcZX10, could you re-review so the merge queue stops refusing it on the old request? Nothing else is pending on the author's side.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5637317062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9186#pullrequestreview-5637317062). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-24T07:21:18Z. **Review:** CHANGES_REQUESTED --- @MarcZX10 both points of your review are addressed on the current head: - The body now says `Depends on: #8223`. - The branch is rebased onto current `main` (Linux build and ctest passed on the rebase, 971/971; `MultisampleTargetStorageView` from `main` is combined with this PR's host-only check). Remaining: this PR rebases onto #8223 once that lands (it is still open and conflicting with `main`), keeping its CPU-write stamp together with the host-only flag. @MarcZX10, could you re-review so the merge queue stops refusing it on the old request? Nothing else is pending on the author's side.
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!9186
No description provided.