fix(agc): preserve hand-built user VGPR offsets #3496
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3496"
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 MarcZX10 on 2026-10-11T11:44:22Z.
What
Issue #3457 reports four titles with hand-built shader headers (
PPSA99039,PPSA99505,PPSA99515andPPSA99997) stopping insceAgcCreatePrimState: theirge_user_vgpr_enspecial is stored atGE_USER_VGPR1(0x25c) with value 0. This change passes that special through at the offset recorded by the shader header instead of rejecting or relocating it.This follows OpenAGC's clean-room reconstruction of the FW 5.50 SPRX, which copies the special register pairs verbatim.
GE_CNTL,VGT_SHADER_STAGES_ENand a usedVGT_GS_OUT_PRIM_TYPEremain checked at the offsets the driver reads. Offset errors now identify the special and the offset found.The implementation adopts screamm's commit
aeaa5080, shared on #3457 after the intake check prevented them from opening a PR. The regression test covers the0x25cpass-through and theGE_CNTLdiagnostic.Tested
Linux, GCC 12.2, Release: built
agc_shader_helpers_tests;agc_shader_helperspassed three consecutive runs.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpassed. The issue contributor reports all four titles get pastsceAgcCreatePrimStatewith this pass-through change; the title then encounters the separately reportedGetImageResourceshader-recompiler error. Windows and console behavior have not been independently retested on this PR head.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 repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T12:00:50Z.
Checked the change against
mainmerged:agc_shader_helperspasses, and without the change the new test case doesn't build/fail. Only{0x25c, 0}is normalized toGE_USER_VGPR_EN; a non-zero value still throws, which is covered by the test.Added by us (pushed to your branch):
sceAgcCreatePrimState: the normalization is inferred from the title's headers and the console's behaviour is unknown.Rebased on current
main, scoped build and ctest green; merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T12:09:40Z.
CI on this head failed in
actions/checkouton all jobs (No url found for submodule path '3rdparty/imgui' in .gitmodules), which comes frommain(gitlink without a.gitmodulesentry), not from this diff. Verdict unchanged; merging oncemainis fixed and CI is green.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T12:31:34Z.
Ran it on Windows: Radeon 860M (RDNA 3.5), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, driver and shader caches emptied.
agc_shader_helperspasses 3/3. EVO Player (PPSA99039), freshly relinked with this branch's.prxfiles, gets pastsceAgcCreatePrimStateand stops at the next blocker reported in #3457:ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:36:18Z.
Thanks for the native Windows run and trace. Getting past
sceAgcCreatePrimStateconfirms the normalization on the reported title; the laterGetImageResourcefailure is the separate next blocker already tracked in #3457. The PR checks remain blocked at checkout by themainimgui mapping issue in #3511.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:50:29Z.
Update after #3511 merged: I rebased this PR onto current
main(a11c8f7f). The patch still only normalizes{GE_USER_VGPR1, 0}toGE_USER_VGPR_EN; the existing helper test and Windows title validation remain the relevant behavior checks.git diff --checkand the conventions check pass on the rebased diff, and CI has restarted. The prior checkout failure from the orphan3rdparty/imguigitlink should no longer apply.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T13:12:43Z.
Update: the rerun on rebased head
b33d2e37is fully green, including conventions and all three relinker jobs. The full Linux/Windows jobs are skipped by the contributor workflow. The previously reported Windows Radeon 860M validation remains the available native title evidence.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T13:43:41Z.
Update on the revised implementation:
ge_user_vgpr_enthrough at the offset recorded by hand-built shader headers, following the SPRX behavior documented by screamm. The earlier zero-value normalization has been removed.agc_shader_helpersregression checks theGE_USER_VGPR1pass-through and the register-specificGE_CNTLdiagnostic. Linux/GCC 12.2 Release build succeeded; the focused CTest passed three consecutive runs. Conventions andgit diff --checkpass.afcaf910are green. Full Linux and Windows jobs are skipped by the contributor workflow.The PR description now reflects the pass-through behavior and credits the implementation. Please review the revised diff when convenient.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:28:41Z.
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)docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603docs/dev/TechnicalDebt.mdL603Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:38:42Z.
Windows check of head
afcaf9101with the five catalog titles that stop on this throw onmaina11c8f7f(Windows 11, RTX 4070, WinLibs GCC 15.2.0 r7, catalog builds witheboot.binandsce_module/libc.prxunwrapped, 60 s each).All five get past
sceAgcCreatePrimState: EVO Player (PPSA99039), PS5VR (PPSA99177), Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997). All five then stop on the same shader at their first draw:That one is separate from this PR. The SRT evaluator handles
SLessThan32since #2072, butIsRuntimeUniformOpleaves it out, so the runtime validator rejects the chain first. I have a one-line fix with a test ready (AchrafReyani:fix/shader-srt-signed-less-than-uniform) and will open it once this PR is in, since that's when it becomes the titles' stop onmain. With both changes:AGC graphics: guest 2D texture descriptor has a nonzero depth or base array.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:56:24Z.
Follow-up: with this PR plus #3807 (signed compare in SRT values) and a branch that reads a linear 2D T#'s DEPTH as its default pitch (to be opened after #3807), all five titles run the full 60 s on Windows with no error. EVO Player, Jelly5 and Nuvio PS5 present 600 frames. PS5VR compiles 150 shaders. Emby5 sits in its library scan.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:29:03Z.
Checked the revised pass-through against OpenAGC's
sceAgcCreatePrimState(copies the special pairs verbatim), build + libSceAgc ctest (20/20) and the newagc_shader_helperscase (it fails to build without the change). CI is green on this head, and the Windows runs above cover the titles. Merging.