fix(agc): prepare combined shader layouts when linking #2071

Merged
STUPIDCONTEM merged 1 commit from upstream-pr/2071 into main 2026-10-10 08:06:57 +00:00
STUPIDCONTEM commented 2026-10-09 06:44:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by STUPIDCONTEM on 2026-10-09T06:44:39Z.


What

Prepare the combined vertex/pixel shader layout in sceAgcLinkShaders after both register sets are available. The helpers prepared each stage on its own, so the pixel stage lacked the cumulative push-constant offset a draw needs after a vertex stage that uses push data. The change calls the existing combined-stage resolver inside the existing preparation transaction. Linking without a pixel shader keeps its single-stage path, and exceptions still prevent publishing partial results.

Title: EVO-PLAYER (PPSA99039) v0.11.0. In @johnmaia's Linux run in #1578, with the PRs for its start-up imports applied, the title builds its 80 pipelines and submits its first frame. The presenter then fails on its ui_sdf pixel shader:

AGC driver: prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=64 pushOffset=16 pushCapacity=112 preparedLayouts= [0,128] [0,0]

That is the combined-stage preparation this change adds. The run is his: I have not run EVO-PLAYER myself, and on main it still stops earlier, at start-up imports (#1578 tables). The signed SRT comparison he reported next to it is #2072.

Tested

Linux, Ubuntu 24.04, GCC 13.3, Release, BUILD_TESTING=ON, SPIRV-Tools on, lavapipe. Head 5ac66b5b (main c963432d merged in).

  • With main's code and this PR's tests, guest_shader_link and agc_shader_helpers fail; with the change they pass. agc_driver_prepared_graphics adds coverage of the prepared-stage path and passes on both.
  • Default and libs builds pass. Full ctest: 579/581 with this change, #2072 and four other fixes stacked on main 69cee68d (rerun on this exact head pending). The two failures also fail on plain main here: agc_driver_vopc_compare (lavapipe) and guest_video_out_output_mode (no Vulkan display). check_conventions.py passes. check_test_registration.py fails on main itself until #2537.
  • Windows: fork run 38018024117 (pending when written). Earlier, at the original base f145139: Windows 10, WinLibs GCC 15.2.0, full CTest 488/488.

Checklist

  • Based on current main (c963432d merged in); no other open PR implements the same change
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • No third-party code added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4797038047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2071). Originally posted by [STUPIDCONTEM](https://github.com/STUPIDCONTEM) on 2026-10-09T06:44:39Z. --- ### What Prepare the combined vertex/pixel shader layout in `sceAgcLinkShaders` after both register sets are available. The helpers prepared each stage on its own, so the pixel stage lacked the cumulative push-constant offset a draw needs after a vertex stage that uses push data. The change calls the existing combined-stage resolver inside the existing preparation transaction. Linking without a pixel shader keeps its single-stage path, and exceptions still prevent publishing partial results. Title: EVO-PLAYER (PPSA99039) v0.11.0. In @johnmaia's Linux run in [#1578](https://github.com/boykopovar/AnyPS5/issues/1578#issuecomment-6072163434), with the PRs for its start-up imports applied, the title builds its 80 pipelines and submits its first frame. The presenter then fails on its `ui_sdf` pixel shader: ``` AGC driver: prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=64 pushOffset=16 pushCapacity=112 preparedLayouts= [0,128] [0,0] ``` That is the combined-stage preparation this change adds. The run is his: I have not run EVO-PLAYER myself, and on `main` it still stops earlier, at start-up imports (#1578 tables). The signed SRT comparison he reported next to it is #2072. ### Tested Linux, Ubuntu 24.04, GCC 13.3, Release, `BUILD_TESTING=ON`, SPIRV-Tools on, lavapipe. Head `5ac66b5b` (`main` c963432d merged in). - With `main`'s code and this PR's tests, `guest_shader_link` and `agc_shader_helpers` fail; with the change they pass. `agc_driver_prepared_graphics` adds coverage of the prepared-stage path and passes on both. - Default and `libs` builds pass. Full `ctest`: 579/581 with this change, #2072 and four other fixes stacked on `main` 69cee68d (rerun on this exact head pending). The two failures also fail on plain `main` here: `agc_driver_vopc_compare` (lavapipe) and `guest_video_out_output_mode` (no Vulkan display). `check_conventions.py` passes. `check_test_registration.py` fails on `main` itself until #2537. - Windows: fork run [38018024117](https://github.com/STUPIDCONTEM/AnyPS5/actions/runs/38018024117) (pending when written). Earlier, at the original base f145139: Windows 10, WinLibs GCC 15.2.0, full CTest 488/488. ### Checklist - [x] Based on current `main` (c963432d merged in); no other open PR implements the same change - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] No third-party code added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-10 05:59:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T05:59:15Z.

Review: CHANGES_REQUESTED


Thanks. Two things to fix:

  • core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp:239-321: CheckCumulativePushLayout passes with the LinkShaders.cpp change reverted (checked locally: agc_shader_helpers and guest_shader_link fail without it, agc_driver_prepared_graphics still passes). It calls PrepareGraphicsStages directly and never goes through sceAgcLinkShaders, so it pins existing behaviour, not this fix. Either drive it through the link path or drop it, so the PR's tests fail without the change.
  • The Conventions check is red: the checklist line "Based on current main; no other open PR implements the same change" is unchecked. Rebase on current main, check that no open PR (#1902, #1928 touch PreparedGraphics.cpp) overlaps, and tick it.

The rest (hook contract in ShaderHelpers.cpp / GuestShaderLink.cpp, null-pixel path unchanged) looks fine and passes locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5477878777 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2071#pullrequestreview-5477878777). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T05:59:15Z. **Review:** CHANGES_REQUESTED --- Thanks. Two things to fix: - `core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp:239-321`: `CheckCumulativePushLayout` passes with the `LinkShaders.cpp` change reverted (checked locally: `agc_shader_helpers` and `guest_shader_link` fail without it, `agc_driver_prepared_graphics` still passes). It calls `PrepareGraphicsStages` directly and never goes through `sceAgcLinkShaders`, so it pins existing behaviour, not this fix. Either drive it through the link path or drop it, so the PR's tests fail without the change. - The Conventions check is red: the checklist line "Based on current `main`; no other open PR implements the same change" is unchecked. Rebase on current `main`, check that no open PR (#1902, #1928 touch `PreparedGraphics.cpp`) overlaps, and tick it. The rest (hook contract in `ShaderHelpers.cpp` / `GuestShaderLink.cpp`, null-pixel path unchanged) looks fine and passes locally.
adriadam10 commented 2026-10-10 08:06:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T08:06:54Z.

Review: APPROVED


Thanks for the update. The PreparedGraphics.cpp test is gone, the checklist is ticked and Conventions is green. Checked on the PR merged onto current main: the scoped build and ctest pass (agc_shader_helpers, guest_shader_link), and both fail with the LinkShaders.cpp change reverted. Null-pixel path unchanged. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5478265377 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2071#pullrequestreview-5478265377). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:06:54Z. **Review:** APPROVED --- Thanks for the update. The `PreparedGraphics.cpp` test is gone, the checklist is ticked and Conventions is green. Checked on the PR merged onto current `main`: the scoped build and ctest pass (`agc_shader_helpers`, `guest_shader_link`), and both fail with the `LinkShaders.cpp` change reverted. Null-pixel path unchanged. Merging once CI is green.
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!2071
No description provided.