Skip to content

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

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
STUPIDCONTEM:fix/linked-shader-stage-abi
Oct 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
STUPIDCONTEM:fix/linked-shader-stage-abi

Conversation

@STUPIDCONTEM

@STUPIDCONTEM STUPIDCONTEM commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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 c963432 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, fix(shader): evaluate signed comparisons in SRT expressions #2072 and four other fixes stacked on main 69cee68 (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 fix(ci): restore main's ctest after #1331 and #1496 #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 (c963432 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

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPEHi56pUMbT1X4VZwStm9
@STUPIDCONTEM
STUPIDCONTEM force-pushed the fix/linked-shader-stage-abi branch from 5ac66b5 to 23443fb Compare October 10, 2026 07:06

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@adriadam10
adriadam10 merged commit 5560b54 into boykopovar:main Oct 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants