sceAgcCreatePrimState rejects the hand-built shader headers of EVO Player (and likely XashPS5): ge_user_vgpr_en at 0x25c #3457
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LeandroLP23 on 2026-10-11T10:58:17Z.
EVO Player (PPSA99039 v0.10.0, sainsaji/EVO-PLAYER-PS5) now gets past start-up on
main(thanks to #3421, #1482 and #3347) and then stops insceAgcCreatePrimState:Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release,
maince4263b1, title relinked with its ownlibc.prxunwrapped.What the title passes
The title builds its shader headers by hand (
evo_agc_shader_header.c, lines 63-69, "ported verbatim from ps5-xash3d-halflife's src/ps5_shader_header.c", so XashPS5 (PPSA19111) most likely carries the same values). Logged at the check for its pre-raster shader (type=2):PrimState.cpprequiresge_cntl0x25b0x25bvgt_shader_stages_en0x2d5(value0x2412010)0x2d5vgt_gs_out_prim_type0x2ce(value 2)0x29bge_user_vgpr_en0x25c(value 0)0x262ge_user_vgpr_en(PrimState.cpp:33).vgt_gs_out_prim_typeoffset doesn't matter for this title:vgt_shader_stages_enhas no GS bit, sosceAgcCreatePrimStatecomputes the output primitive type fromprim_typeand never reads that special. (In the driver0x2ceis a different context register, the oneState.cpp:522reads as vertices per primitive.)The title runs on the console with these headers, so the console's
sceAgcCreatePrimStatepresumably doesn't reject them; AnyPS5 is stricter here.What happens past it
As an experiment only (not a proposed change), I let the check accept the title's
ge_user_vgpr_enand emitted it atGE_USER_VGPR_ENwith the title's value (0). EVO Player then gets pastsceAgcCreatePrimStateand stops later, in the shader recompiler:Whether
sceAgcCreatePrimStateshould pass the registers through as given or normalizege_user_vgpr_ento its offset is for you to decide; I haven't opened a PR for that reason.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T11:25:58Z.
Data for priority: on Windows (main
03a84d02, RTX 4070, WinLibs GCC 15.2.0 r7), four catalog titles stop on this throw. Each ran witheboot.binandsce_module/libc.prxunwrapped, 60 s:what(): sceAgcCreatePrimState: invalid user configuration register offsetsAll four ship the same hand-built shader-header code, so whichever way this is decided unblocks all of them together.
On the register itself: in the GFX10 user-config map,
0x25c(the offset these headers store forge_user_vgpr_en) isGE_USER_VGPR1, next toGE_USER_VGPR_ENat0x262. With value 0 in both, a consolesceAgcCreatePrimStatethat passes the special through without checking its offset would have the title write 0 toGE_USER_VGPR1, which wouldn't change anything. That would fit these titles running on hardware. I haven't verified it on a console.Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T12:06:37Z.
Fix branch ready:
screamm:fix/agc-prim-state-user-config-offsets(aeaa5080, one commit onmain0f863c10). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is.On current
mainthe four titles that build their shader headers from EVO-PLAYER-PS5'sevo_agc_shader_header.c(9ee9a542, lines 63 to 69:ge_cntlat 0x25b,vgt_shader_stages_enat 0x2d5,vgt_gs_out_prim_typeat 0x2ce,ge_user_vgpr_enstored at 0x25c,GE_USER_VGPR1) stop withwhat(): sceAgcCreatePrimState: invalid user configuration register offsets: EVO Player PPSA99039, PPSA99505, PPSA99515 and Nuvio PPSA99997 (fresh Windows relink,--windows --registry unused-filter=0).The sources settle it as a check that is too strict rather than a missing translation: OpenAGC's reconstruction of the FW 5.50 SPRX (
game_compat.clines 1181 to 1252 at3c7e8072) copies all four special register pairs to the outputs as stored and never checks their offsets; KytyPS5 (agc.cpplines 1034 to 1100 at16a7fe68) checks them only throughEXIT_NOT_IMPLEMENTED, which marks what the emulator does not handle, not what the SDK rejects; the titles ship and run on the console with these headers; and this driver never readsGE_USER_VGPR_EN(0x262) orGE_USER_VGPR1(0x25c). The change inShader/src/PrimState.cpptherefore copiesge_user_vgpr_enfrom either shader at the offset the header stores (not moved to 0x262, nothing supports that), keeps throwing for a wrongge_cntl,vgt_shader_stages_enor usedvgt_gs_out_prim_typeoffset because the driver reads those registers at their own offsets, and names the register and offset in the message. TechnicalDebt records the reasoning and that it rests on OpenAGC's reconstruction.agc_shader_helpersgains the titles' table (prim type 4) creating withge_user_vgpr_enat 0x25c and the computedVGT_GS_OUT_PRIM_TYPE, andge_cntlmoved to 0x25c still throwing withGE_CNTLand0x25cin the message; with the oldPrimState.cppthe test fails.Runtime check: with the rebuilt
libSceAgc.prxall four titles get pastsceAgcCreatePrimStateand stop at the next blocker this issue predicted,ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value. One thing to keep in mind afterwards:DecodeRegisteredStatewrites the titles'vgt_gs_out_prim_type(2) into context register 0x2ce, whichState.cppreads as vertices per primitive, although the SPRX would ignore that special with no geometry shader.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:agc_shader_helpers,agc_commands,agc_initialization3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"533/534, the one failure beingwindows_exceptions(#3411);tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T13:33:21Z.
Thanks for sharing the implementation and the source analysis. I integrated commit
aeaa5080into my existing PR #3496, so the pass-through fix and its regression test can be reviewed in one PR. The PR now preservesge_user_vgpr_enat the header's offset and retains checks for the special registers the driver reads. I credited your commit in the PR description. Thanks for testing the four titles.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T21:33:07Z.
Fixed by #3496, merged in
59559c306.