fix(agc): publish a written native multisample D32S8 owner without HTILE to its depth and stencil planes #15688

Merged
hugodearaujo merged 5 commits from upstream-pr/15688 into main 2026-11-09 01:46:30 +00:00
hugodearaujo commented 2026-11-04 05:35:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-11-04T05:35:21Z.


What

#13021 publishes a written native multisample D32S8 owner to its guest planes, but only an owner with three planes (depth, HTILE, stencil). #14005 imports a D32S8 target without HTILE whose depth and separate stencil planes each hold one value; once the host draws into it, a guest read of its planes throws sample-preserving guest publication of native multisample depth is not implemented for this owner. As discussed on #13021, this is the follow-up for that two-plane owner.

PublishToGuest now also accepts the owner of a uniformPlaneTarget (D32S8, separate stencil plane, no HTILE) when it holds two publication planes. The depth and stencil samples are read back and retiled exactly as for the three-plane owner; the stencil plane is plane 1 instead of plane 2, and there is no HTILE to expand. Everything else is #13021's publication: the same snapshot, live-range, racing-write, allocation-lease and commit checks, and the owner stays resident afterwards. Owners with HTILE still need three planes, and D16/D32-only owners still throw.

Tested

Linux 7.2.11, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.

  • New agc_driver_native_depth_publication_without_htile (--publication-without-htile): a uniform-plane D32S8 owner without HTILE, drawn with per-sample depth and stencil, then read by the guest.
    • At 2, 4 and 8 samples: the read publishes every depth and stencil sample, padding included; the owner is reused; a second draw and read publish the new samples.
    • At 4 samples: guest stores to a page of each plane before the read are kept in the published planes (the owner stays resident); a CPU store into the stencil plane while the publication copies, and one between the depth and stencil commits, are kept, the read throws guest writes raced native multisample depth publication, and the owner stays resident (the depth plane is already committed in the second case).
    • On main with only the test added, it fails with sample-preserving guest publication of native multisample depth is not implemented for this owner.
  • Validation layer, paired, same machine (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1), the 15 tests of agc_driver_native_multisample_depth_tests (agc_driver_native_multisample_depth and agc_driver_native_depth_*), on main acf7ac208a: with DepthSurface.cpp from main and the new test, 14 of 15 pass (the new test fails as above); with this change, 15 of 15. Neither log has a VUID- line or "was not found but was requested". The same pair on main 1c8c0efc8c gave the same result.
  • tools/check_conventions.py: passes.
  • Title: Assassin's Creed Mirage (PPSA13960), title → New Game → Assassin → Full Synchronization Off, on main 1c8c0efc8c + #13963 (fc1dfc03ab, needed for an earlier stop):
    • without this change: stops at 469 s on compute shader 0x10b4c89700: AGC graphics: sample-preserving guest publication of native multisample depth is not implemented for this owner. The owner is a 4-sample 1920x1080 D32S8 target without HTILE (depth and stencil planes, imported through #14005).
    • with it: that owner is published (every byte the host's, nothing taken from the guest) and the title goes on to the next stop, at 476 s: a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented. That stop is the title binding the same planes at 1872x1056 (dynamic resolution), which a separate PR handles.

Checklist

  • Based on current main; no other open PR implements the same functions (#9950 and #10469 change the same publication.size() check for D32 owners without stencil, so whichever lands second has a one-line conflict there)
  • 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: none (tested in the title together with #13963)
  • Fixes: none
  • Unblocks: PPSA13960 #7534 (moves it to its next stop)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Linux 7.2.11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5149455272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15688). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-11-04T05:35:21Z. --- ### What #13021 publishes a written native multisample D32S8 owner to its guest planes, but only an owner with three planes (depth, HTILE, stencil). #14005 imports a D32S8 target without HTILE whose depth and separate stencil planes each hold one value; once the host draws into it, a guest read of its planes throws `sample-preserving guest publication of native multisample depth is not implemented for this owner`. As discussed on #13021, this is the follow-up for that two-plane owner. `PublishToGuest` now also accepts the owner of a `uniformPlaneTarget` (D32S8, separate stencil plane, no HTILE) when it holds two publication planes. The depth and stencil samples are read back and retiled exactly as for the three-plane owner; the stencil plane is plane 1 instead of plane 2, and there is no HTILE to expand. Everything else is #13021's publication: the same snapshot, live-range, racing-write, allocation-lease and commit checks, and the owner stays resident afterwards. Owners with HTILE still need three planes, and D16/D32-only owners still throw. ### Tested Linux 7.2.11, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests. - New `agc_driver_native_depth_publication_without_htile` (`--publication-without-htile`): a uniform-plane D32S8 owner without HTILE, drawn with per-sample depth and stencil, then read by the guest. - At 2, 4 and 8 samples: the read publishes every depth and stencil sample, padding included; the owner is reused; a second draw and read publish the new samples. - At 4 samples: guest stores to a page of each plane before the read are kept in the published planes (the owner stays resident); a CPU store into the stencil plane while the publication copies, and one between the depth and stencil commits, are kept, the read throws `guest writes raced native multisample depth publication`, and the owner stays resident (the depth plane is already committed in the second case). - On `main` with only the test added, it fails with `sample-preserving guest publication of native multisample depth is not implemented for this owner`. - Validation layer, paired, same machine (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`), the 15 tests of `agc_driver_native_multisample_depth_tests` (`agc_driver_native_multisample_depth` and `agc_driver_native_depth_*`), on `main` acf7ac208a: with `DepthSurface.cpp` from `main` and the new test, 14 of 15 pass (the new test fails as above); with this change, 15 of 15. Neither log has a `VUID-` line or "was not found but was requested". The same pair on `main` 1c8c0efc8c gave the same result. - `tools/check_conventions.py`: passes. - Title: Assassin's Creed Mirage (PPSA13960), title → New Game → Assassin → Full Synchronization Off, on `main` 1c8c0efc8c + #13963 (fc1dfc03ab, needed for an earlier stop): - without this change: stops at 469 s on `compute shader 0x10b4c89700: AGC graphics: sample-preserving guest publication of native multisample depth is not implemented for this owner`. The owner is a 4-sample 1920x1080 D32S8 target without HTILE (depth and stencil planes, imported through #14005). - with it: that owner is published (every byte the host's, nothing taken from the guest) and the title goes on to the next stop, at 476 s: `a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented`. That stop is the title binding the same planes at 1872x1056 (dynamic resolution), which a separate PR handles. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#9950 and #10469 change the same `publication.size()` check for D32 owners without stencil, so whichever lands second has a one-line conflict there) - [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: none (tested in the title together with #13963) - [x] Fixes: none - [x] Unblocks: PPSA13960 #7534 (moves it to its next stop) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Linux 7.2.11 - [x] AI-assisted: yes
Superseabas commented 2026-11-04 17:09:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-04T17:09:47Z.

Review: APPROVED


Head fa590e435a merged onto current main b11c7bf84f (clean merge, local only): code read, red/green check and a run on AMD's Windows driver, with an NVIDIA Blackwell run alongside. I reviewed it as the base of #15690 and #15707.

Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release, BUILD_TESTING=ON. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -R '^agc_driver_native_(depth|multisample_depth).*$', ANYPS5_GPU selecting the device (confirmed by Selected GPU):

GPU Driver main merged
NVIDIA GeForce RTX 5070 Ti (10de:2c05) 621.01 16 + 1 skip 18 + 1 skip
AMD Radeon Graphics, Ryzen 7 7700X iGPU (1002:164e) AMD 26.10.2 16 + 1 skip 18 + 1 skip
  • The skip is agc_driver_native_depth_driver_queued_fill, as on main. There are no VUID- lines and no missing-layer line in any run.
  • Red check: the merged tree with this PR's DepthSurface.cpp change reversed fails the new agc_driver_native_depth_publication_without_htile on both GPUs. It fails with sample-preserving guest publication of native multisample depth is not implemented for this owner.
  • check_conventions.py --base main passes on the merge.

Read through the change: PublishToGuest now accepts a no-HTILE (uniformPlaneTarget) D32S8 owner with two publication entries. The stencil plane is the last entry (publication.size() - 1), and the HTILE expansion into result[1] runs only when the owner has HTILE. The other requirements are unchanged. These are the format, an empty sampling refusal, proven stencil and no pending clears. I found nothing to change.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5772536579 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15688#pullrequestreview-5772536579). Originally posted by [Superseabas](https://github.com/Superseabas) on 2026-11-04T17:09:47Z. **Review:** APPROVED --- Head `fa590e435a` merged onto current `main` `b11c7bf84f` (clean merge, local only): code read, red/green check and a run on AMD's Windows driver, with an NVIDIA Blackwell run alongside. I reviewed it as the base of #15690 and #15707. Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (`x86_64-ucrt-posix-seh`, r3), Release, `BUILD_TESTING=ON`. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest -R '^agc_driver_native_(depth|multisample_depth).*$'`, `ANYPS5_GPU` selecting the device (confirmed by `Selected GPU`): | GPU | Driver | `main` | merged | |---|---|---|---| | NVIDIA GeForce RTX 5070 Ti (`10de:2c05`) | 621.01 | 16 + 1 skip | 18 + 1 skip | | AMD Radeon Graphics, Ryzen 7 7700X iGPU (`1002:164e`) | AMD 26.10.2 | 16 + 1 skip | 18 + 1 skip | - The skip is `agc_driver_native_depth_driver_queued_fill`, as on `main`. There are no `VUID-` lines and no missing-layer line in any run. - Red check: the merged tree with this PR's `DepthSurface.cpp` change reversed fails the new `agc_driver_native_depth_publication_without_htile` on both GPUs. It fails with `sample-preserving guest publication of native multisample depth is not implemented for this owner`. - `check_conventions.py --base main` passes on the merge. Read through the change: `PublishToGuest` now accepts a no-HTILE (`uniformPlaneTarget`) D32S8 owner with two publication entries. The stencil plane is the last entry (`publication.size() - 1`), and the HTILE expansion into `result[1]` runs only when the owner has HTILE. The other requirements are unchanged. These are the format, an empty sampling refusal, proven stencil and no pending clears. I found nothing to change. AI-assisted: yes (Claude Code)
gabichuuuuu commented 2026-11-08 12:41:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T12:41:14Z.

Review: COMMENTED


Ran 79a72e5259 merged on main 302864d48c on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos validation layer 1.4.368), ctest -R '^agc_driver_native_(multisample_depth|depth_)' -V.

main change, 2 runs each
NVIDIA 20/20 21/21 both times
Intel 17/20 17/21 both times

The new agc_driver_native_depth_publication_without_htile fails on the Intel iGPU, both runs: "a written D32S8 owner without HTILE did not publish its stencil samples and padding". On NVIDIA it passes. The other three Intel failures (native_depth_stencil_view, uniform_planes, publication) are the same on main (#16883), so on this driver D32S8 stencil already reads wrong on main, and the new case may hit the same thing rather than this change. Still, it doesn't pass here.

The layer was inserted in every test, no log has was not found but was requested by env var VK_INSTANCE_LAYERS, and no log on either side has a VUID-. #15690 and #15707, which build on this branch, add a dispatch over Intel's maxComputeWorkGroupCount[0] (see #15690); this PR doesn't.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5817911199 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15688#pullrequestreview-5817911199). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T12:41:14Z. **Review:** COMMENTED --- Ran `79a72e5259` merged on `main` 302864d48c on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Khronos validation layer 1.4.368), `ctest -R '^agc_driver_native_(multisample_depth|depth_)' -V`. | | `main` | change, 2 runs each | |---|---|---| | NVIDIA | 20/20 | 21/21 both times | | Intel | 17/20 | 17/21 both times | **The new `agc_driver_native_depth_publication_without_htile` fails on the Intel iGPU**, both runs: "a written D32S8 owner without HTILE did not publish its stencil samples and padding". On NVIDIA it passes. The other three Intel failures (`native_depth_stencil_view`, `uniform_planes`, `publication`) are the same on `main` (#16883), so on this driver D32S8 stencil already reads wrong on `main`, and the new case may hit the same thing rather than this change. Still, it doesn't pass here. The layer was inserted in every test, no log has `was not found but was requested by env var VK_INSTANCE_LAYERS`, and no log on either side has a `VUID-`. #15690 and #15707, which build on this branch, add a dispatch over Intel's `maxComputeWorkGroupCount[0]` (see #15690); this PR doesn't. AI-assisted: yes.
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!15688
No description provided.