fix(agc): select the registered back half for a fused hull header #3444
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3444"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-11T10:42:26Z.
What
For hull halves,
sceAgcFuseShaderHalvesreturns a copy of the back half (type 7,HsBack) and doesn't register it. The copy is marked type 3 (Hs), hasuser_datacleared, and has its shader registers copied to the caller's scratch memory, where the checksum (0x100),SPI_SHADER_PGM_RSRC1_HS/RSRC2_HSand the LS program address (0x148/0x149) are rewritten. Fused geometry halves are registered as a new program; fused hull halves aren't, because the code stays where it was. Draws already find both halves through0x148(type 5) and0x108(type 7).sceAgcCreatePrimStateonly accepts a hull of typeHs, so a title passes the fused header.ResolveGraphicsStagesAbithen finds no registered header equal to it and throwsgraphics ABI refers to a replaced shader header.SameHeaderalso takes a type-3 header as a registered type-7 header for the same code. Every other field must be equal, and the shader registers must have the same offsets in the same order. Values may differ only in the five registers fusion rewrites. Anything else is still refused.ResolveGraphicsStagesAbiapplies the bound header's shader registers over the registered state. The ABI is then keyed on the values the title actually binds: the merged RSRC words and the LS address.ARCHITECTURE.mddescribes the rule.Ghost of Yōtei (PPSA26344, 01.008) fuses its hull halves while its loading screen is up, and stopped there on every run:
(The
[debug-header]lines come from a local diagnostic that isn't part of this change.) With this change the fused header resolves to its back half ("ABI header @7ff6aca54268 matched registered header @8000038c80"), and the title gets past this point. Its next stop is a tessellation mode the reference path doesn't support yet, which is a separate topic. Context: #675.Tested
Windows 11, MinGW-w64 GCC 15.2 (WinLibs), Release, RTX 4090.
FusedHullHeaderSelectioninagc_driver_prepared_publication: a fused header built the waysceAgcFuseShaderHalvesbuilds one selects its registered back half. Changing a hull program register, a register offset, a scalar field or the type is still refused. Without theSameHeaderchange the first check fails.cteston currentmain(02030f8a6) plus this change: 829 of 830 pass (5video_outtests skipped on this machine). The one failure,windows_exceptions(0xc0000409), is a libc test built only from files this change doesn't touch, so it fails onmainhere too; #3415 looks like its fix.sceAgcCreatePrimState.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T10:43:09Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/tests/execution/PreparedPublication.cppL236Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:44:56Z.
Checked the build and
agc_driver_prepared_publicationon Linux (passes; it does not compile without the change), the fused-register set against the PR description, the bounds checks on the guest register arrays, and the ARCHITECTURE.md update; merging.