fix(agc): pass the depth bounds test when both depth planes are absent #2179

Merged
oneandonlydean merged 1 commit from upstream-pr/2179 into main 2026-10-10 04:44:54 +00:00
oneandonlydean commented 2026-10-09 10:42:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T10:42:07Z.


What

#453 (48ebf3195e, "skip depth and stencil tests whose plane is absent") renders depth and stencil tests without a depth target when DB_Z_INFO and DB_STENCIL_INFO both have FORMAT INVALID: with no plane, there is nothing to test, and every test passes.

The depth bounds test (DB_DEPTH_CONTROL bit 3) reads the same absent depth plane, but such a draw still threw:

[videoout] presentation failed: AGC graphics: depth bounds without a depth surface

Depth bounds now follow the same rule when both planes are absent: no depth target, and no bounds test. The change is in DecodeState and DrawRejection, core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp.

With an absent depth plane beside a present stencil plane, the bounds test still throws depth bounds without a depth plane, as before.

This is the same claim #453 makes for the depth and stencil tests. It also matches the Vulkan rule that the bounds test passes without a depth attachment. It is not checked on hardware.

Tested

  • Linux (CachyOS, GCC 16.2, RTX 4090, NVIDIA 610.57), on main a8b032b236: ctest 495/495. tools/check_conventions.py passes.
  • agc_driver_graphics, stateTests:
    • bounds plus depth and stencil tests (DB_DEPTH_CONTROL 0x007007bb), and bounds alone (8), on two absent planes decode with no depth target and are not rejected. On main both throw.
    • bounds on an absent depth plane beside a stencil plane still throws.
  • A heavier title: the first presentation after a level starts failed with the line above. With this, the level renders.

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 (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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4799321934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2179). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T10:42:07Z. --- ### What #453 (48ebf3195e, "skip depth and stencil tests whose plane is absent") renders depth and stencil tests without a depth target when `DB_Z_INFO` and `DB_STENCIL_INFO` both have FORMAT INVALID: with no plane, there is nothing to test, and every test passes. The depth bounds test (`DB_DEPTH_CONTROL` bit 3) reads the same absent depth plane, but such a draw still threw: ``` [videoout] presentation failed: AGC graphics: depth bounds without a depth surface ``` Depth bounds now follow the same rule when both planes are absent: no depth target, and no bounds test. The change is in `DecodeState` and `DrawRejection`, `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`. With an absent depth plane beside a present stencil plane, the bounds test still throws `depth bounds without a depth plane`, as before. This is the same claim #453 makes for the depth and stencil tests. It also matches the Vulkan rule that the bounds test passes without a depth attachment. It is not checked on hardware. ### Tested - Linux (CachyOS, GCC 16.2, RTX 4090, NVIDIA 610.57), on `main` a8b032b236: ctest 495/495. `tools/check_conventions.py` passes. - `agc_driver_graphics`, `stateTests`: - bounds plus depth and stencil tests (`DB_DEPTH_CONTROL` 0x007007bb), and bounds alone (8), on two absent planes decode with no depth target and are not rejected. On `main` both throw. - bounds on an absent depth plane beside a stencil plane still throws. - A heavier title: the first presentation after a level starts failed with the line above. With this, the level renders. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
popcoder565 commented 2026-10-09 15:24:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:24:38Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 5fbe3998, merged onto main d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run.

  • This PR's tests pass: agc_driver_graphics. None of them reported skipping a case.
  • Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows PATH setup.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083910048 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2179#issuecomment-6083910048). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:24:38Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `5fbe3998`, merged onto `main` d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run. - This PR's tests pass: `agc_driver_graphics`. None of them reported skipping a case. - Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows `PATH` setup. No title was run. _🤖 Addressed by [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!2179
No description provided.