fix(agc): SPI_PS_INPUT_ENA/ADDR start at their reset value #1178

Merged
MichonGoddijn231849 merged 2 commits from upstream-pr/1178 into main 2026-10-08 09:11:34 +00:00
MichonGoddijn231849 commented 2026-10-07 16:44:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T16:44:23Z.


What

A context that never wrote SPI_PS_INPUT_ENA or SPI_PS_INPUT_ADDR after CLEAR_STATE reads them as zero, like the hardware, instead of refusing the draw for a missing register. GTA V does this for a depth-only draw whose pixel shader takes no inputs.

Tested

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

  • GTA V PPSA04264 (01.005) runs with this change on the combined gta-v/testing branch (Performance mode, the prologue).
  • On this branch: builds, and ctest passes. Not run here: the relinker's Python tests (my local Python does not find their helper modules) and guest_gameupdate.

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. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4775675154 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1178). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T16:44:23Z. --- ### What A context that never wrote SPI_PS_INPUT_ENA or SPI_PS_INPUT_ADDR after CLEAR_STATE reads them as zero, like the hardware, instead of refusing the draw for a missing register. GTA V does this for a depth-only draw whose pixel shader takes no inputs. ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB, MinGW-w64 GCC 15.2.0. - GTA V PPSA04264 (01.005) runs with this change on the combined [`gta-v/testing`](https://github.com/MichonGoddijn231849/AnyPS5-fork/tree/gta-v/testing) branch (Performance mode, the prologue). - On this branch: builds, and `ctest` passes. Not run here: the relinker's Python tests (my local Python does not find their helper modules) and `guest_gameupdate`. ### 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. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
orbz22 commented 2026-10-08 03:15:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-08T03:15:49Z.


Tested with Astro's Playroom (PPSA01325) on Windows 11 (RTX 3060 Laptop, WinLibs GCC 15.2.0 r7), on a local branch that also carries #283, #285, #425, #570, #759, #903 and #1072.

Without this change, 5 draws per frame are refused with missing register at DWORD 0x1b3: 2230 refusals over 445 presents, all with color target 0 and mask 0. With it, I counted 0 refusals over 506 presents:

  • 3 of the 5 draws now run. Successful draws go from 24.0 to 27.2 per present.
  • The other 2 move on to the next check and fail there with depth/stencil clear, copy, resummarize or decompress draws (DB_RENDER_CONTROL) is unsupported (register 0x0 = 0x00000002). 0x2 is the stencil clear bit, which is the case #1395 handles. This change does not cover it.

No other draw failures appeared, and the frame dumps through the intro look the same as before.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051436631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1178#issuecomment-6051436631). Originally posted by [orbz22](https://github.com/orbz22) on 2026-10-08T03:15:49Z. --- Tested with Astro's Playroom (PPSA01325) on Windows 11 (RTX 3060 Laptop, WinLibs GCC 15.2.0 r7), on a local branch that also carries #283, #285, #425, #570, #759, #903 and #1072. Without this change, 5 draws per frame are refused with `missing register at DWORD 0x1b3`: 2230 refusals over 445 presents, all with color target 0 and mask 0. With it, I counted 0 refusals over 506 presents: - 3 of the 5 draws now run. Successful draws go from 24.0 to 27.2 per present. - The other 2 move on to the next check and fail there with `depth/stencil clear, copy, resummarize or decompress draws (DB_RENDER_CONTROL) is unsupported (register 0x0 = 0x00000002)`. 0x2 is the stencil clear bit, which is the case #1395 handles. This change does not cover it. No other draw failures appeared, and the frame dumps through the intro look the same as before.
adriadam10 commented 2026-10-08 08:48:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T08:48:17Z.


Checked: build + full ctest green on current main + this PR; the change matches the CLEAR_STATE reset list (0x1b3/0x1b4 = 0), and the existing tests that erase 0x1b3 explicitly still require the rejection for a real pixel program.
The PR had no test, so I added one commit pinning it: Submit.cpp checks that CLEAR_STATE leaves SPI_PS_INPUT_ENA/ADDR present and 0 (fails without the change, passes with it). Merging once CI is green on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6056223022 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1178#issuecomment-6056223022). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T08:48:17Z. --- Checked: build + full ctest green on current main + this PR; the change matches the CLEAR_STATE reset list (0x1b3/0x1b4 = 0), and the existing tests that erase 0x1b3 explicitly still require the rejection for a real pixel program. The PR had no test, so I added one commit pinning it: `Submit.cpp` checks that CLEAR_STATE leaves SPI_PS_INPUT_ENA/ADDR present and 0 (fails without the change, passes with it). Merging once CI is green on the new head.
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!1178
No description provided.