fix(agc): import a depth plane aliased by a cleared R32F target #15443

Merged
edubox merged 6 commits from upstream-pr/15443 into main 2026-11-08 18:07:25 +00:00
edubox commented 2026-11-03 10:12:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-11-03T10:12:23Z.


What

A native multisample depth plane whose guest range exactly aliases a multisampled R32F colour target can now take the value that target's clear or fill proves, instead of refusing the depth import. This covers both import paths:

  • Without HTILE (the uniform-plane path), the depth value comes from the R32F clear instead of guest memory, whose samples are only on the host.
  • With HTILE, the metadata must prove the same value; a colour clear that disagrees with the HTILE is still refused.

A colour target that has drawn, a non-R32F format, or a clear value outside [0, 1] is still refused. CheckCurrent repeats the check, so an imported depth stays valid only while the colour alias still proves the imported value.

7th Guest (PPSA17019) previously stopped at native multisample depth or HTILE aliases a multisampled colour target whose samples are only on the host; with this it advances to the next, separate blocker (overlapping native multisample depth clear transitions are not implemented).

Tested

Linux x86-64 (CachyOS), GCC 16.2.1, Release, NVIDIA GeForce RTX 4080 SUPER (driver 615.78.8.0):

  • New agc_driver_native_depth_uniform_plane_alias and agc_driver_native_depth_htile_plane_alias cases: clears 0 and 1.0, a drawn target, and a clear outside [0, 1], with 2, 4 and 8 samples.
  • ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R 'agc_driver_native_depth|^agc_driver_graphics$|^agc_driver_key_miss$|^agc_driver_bda_device$|^agc_driver_recorder$': 19/19 pass on the change, 17/17 on main (4f41f4c375).
  • VK_LAYER_KHRONOS_validation is not installed on this host, so the validation-layer comparison could not be run.
  • tools/check_conventions.py --base origin/main and git diff --check are clean.
  • tools/pr_overlap.py --branch fix/agc-aliased-uniform-depth flags a shared DepthSurface.cpp with #14969 and #15059; reviewed manually: they touch stencil retirement/flush and surface-size helpers, not this import or check path.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 615.78.8.0, Linux (CachyOS, x86-64)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5135433588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15443). Originally posted by [edubox](https://github.com/edubox) on 2026-11-03T10:12:23Z. --- ### What A native multisample depth plane whose guest range exactly aliases a multisampled R32F colour target can now take the value that target's clear or fill proves, instead of refusing the depth import. This covers both import paths: - Without HTILE (the uniform-plane path), the depth value comes from the R32F clear instead of guest memory, whose samples are only on the host. - With HTILE, the metadata must prove the same value; a colour clear that disagrees with the HTILE is still refused. A colour target that has drawn, a non-R32F format, or a clear value outside `[0, 1]` is still refused. `CheckCurrent` repeats the check, so an imported depth stays valid only while the colour alias still proves the imported value. 7th Guest (PPSA17019) previously stopped at `native multisample depth or HTILE aliases a multisampled colour target whose samples are only on the host`; with this it advances to the next, separate blocker (`overlapping native multisample depth clear transitions are not implemented`). ### Tested Linux x86-64 (CachyOS), GCC 16.2.1, Release, NVIDIA GeForce RTX 4080 SUPER (driver 615.78.8.0): - New `agc_driver_native_depth_uniform_plane_alias` and `agc_driver_native_depth_htile_plane_alias` cases: clears 0 and 1.0, a drawn target, and a clear outside `[0, 1]`, with 2, 4 and 8 samples. - `ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R 'agc_driver_native_depth|^agc_driver_graphics$|^agc_driver_key_miss$|^agc_driver_bda_device$|^agc_driver_recorder$'`: 19/19 pass on the change, 17/17 on `main` (`4f41f4c375`). - `VK_LAYER_KHRONOS_validation` is not installed on this host, so the validation-layer comparison could not be run. - `tools/check_conventions.py --base origin/main` and `git diff --check` are clean. - `tools/pr_overlap.py --branch fix/agc-aliased-uniform-depth` flags a shared `DepthSurface.cpp` with #14969 and #15059; reviewed manually: they touch stencil retirement/flush and surface-size helpers, not this import or check path. ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 615.78.8.0, Linux (CachyOS, x86-64) - [x] 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!15443
No description provided.