Skip to content

fix(agc): skip prim state preparation for a patch/hull mismatch - #2293

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:fix/agc-prim-state-patch-hs
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:fix/agc-prim-state-patch-hs

Conversation

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor

What

Since #639, sceAgcCreatePrimState also resolves the graphics ABI ahead of time, and that resolve throws when the primitive type is a patch list without HS_EN, or a hull stage is set with another primitive type. GTA V (PPSA04264) creates such a prim state while it loads, so on current main it aborts a few seconds after launch with AGC graphics: VGT_SHADER_STAGES_EN=0x2002000: Patch topology and HS_EN disagree.

No draw can use a state like that, so the ahead-of-time preparation is skipped for it and the packed registers are still returned. A draw that does use such a state still fails in the draw-time check, as before. Bit 2 of VGT_SHADER_STAGES_EN is HS_EN, not an NGG bit, so the constant is renamed.

The fix and its test are by @CouchRiv, who prepared it on Linux and asked me to open it.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080, MinGW-w64 GCC 15.2.0, on main d70b899.

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
  • 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); I reviewed and tested it.

🤖 Generated with Claude Code

sceAgcCreatePrimState only packs registers, but it now also resolves the
graphics ABI ahead of time, and that resolve throws when the primitive
type is a patch list without HS_EN or a hull stage with another type.
No draw can use such a state, so leave it to draw time and return the
registers. Bit 2 of VGT_SHADER_STAGES_EN is HS_EN, not an NGG bit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the agc libSceAgc* label Oct 9, 2026
@MarcZX10

MarcZX10 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

I updated PR #2066 onto current main and moved its regression cases into a dedicated helper, so the test additions no longer share the same insertion hunk. #2066 covers optional geometry output register handling; #2293 covers the patch/hull mismatch path. They are separate fixes with no dependency.

oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
@oneandonlydean
oneandonlydean merged commit a7aa802 into boykopovar:main Oct 10, 2026
8 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…rim-state-patch-hs

fix(agc): skip prim state preparation for a patch/hull mismatch
VohminV added a commit to VohminV/-AnyPS5- that referenced this pull request Oct 17, 2026
…llation fixes

- skip graphics ABI preparation on patch/hull stage mismatch (PR boykopovar#2293), rename NGG_BIT to HS_BIT
- accept user-data presence and type header aliases; tolerate unregistered shader programs at draw decode
- resolve PackedAncillary pixel inputs instead of failing validation
- permit bit 25 in tessellation routing; default zero tess config to triangular/odd/clockwise
- always commit the graphics ABI transaction so a skip cannot poison later preparations
- rate-limited SubmitFlip/present diagnostics for VideoOut
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.

4 participants