sceAgcCreatePrimState rejects the hand-built shader headers of EVO Player (and likely XashPS5): ge_user_vgpr_en at 0x25c #3457

Closed
opened 2026-10-11 10:58:17 +00:00 by LeandroLP23 · 4 comments
LeandroLP23 commented 2026-10-11 10:58:17 +00:00 (Migrated from github.com)
Contributor

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 in sceAgcCreatePrimState:

terminate called after throwing an instance of 'std::runtime_error'
  what():  sceAgcCreatePrimState: invalid user configuration register offsets

Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, main ce4263b1, title relinked with its own libc.prx unwrapped.

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):

Special register Offset the title stores Offset PrimState.cpp requires
ge_cntl 0x25b 0x25b
vgt_shader_stages_en 0x2d5 (value 0x2412010) 0x2d5
vgt_gs_out_prim_type 0x2ce (value 2) 0x29b
ge_user_vgpr_en 0x25c (value 0) 0x262
  • The throw comes from ge_user_vgpr_en (PrimState.cpp:33).
  • The vgt_gs_out_prim_type offset doesn't matter for this title: vgt_shader_stages_en has no GS bit, so sceAgcCreatePrimState computes the output primitive type from prim_type and never reads that special. (In the driver 0x2ce is a different context register, the one State.cpp:522 reads as vertices per primitive.)

The title runs on the console with these headers, so the console's sceAgcCreatePrimState presumably 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_en and emitted it at GE_USER_VGPR_EN with the title's value (0). EVO Player then gets past sceAgcCreatePrimState and stops later, in the shader recompiler:

ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value; chain: SelectU32(SLessThan32(ReadConst(GetSrtResource, Immediate), Immediate), ReadConst(GetSrtResource, ...

Whether sceAgcCreatePrimState should pass the registers through as given or normalize ge_user_vgpr_en to its offset is for you to decide; I haven't opened a PR for that reason.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5800427572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3457). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-11T10:58:17Z. --- EVO Player (PPSA99039 v0.10.0, [sainsaji/EVO-PLAYER-PS5](https://github.com/sainsaji/EVO-PLAYER-PS5)) now gets past start-up on `main` (thanks to #3421, #1482 and #3347) and then stops in `sceAgcCreatePrimState`: ``` terminate called after throwing an instance of 'std::runtime_error' what(): sceAgcCreatePrimState: invalid user configuration register offsets ``` Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, `main` ce4263b1, title relinked with its own `libc.prx` unwrapped. ### What the title passes The title builds its shader headers by hand ([`evo_agc_shader_header.c`](https://github.com/sainsaji/EVO-PLAYER-PS5/blob/main/projects/evoplayer/media/src/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`): | Special register | Offset the title stores | Offset `PrimState.cpp` requires | |---|---|---| | `ge_cntl` | `0x25b` | `0x25b` | | `vgt_shader_stages_en` | `0x2d5` (value `0x2412010`) | `0x2d5` | | `vgt_gs_out_prim_type` | `0x2ce` (value 2) | `0x29b` | | `ge_user_vgpr_en` | **`0x25c`** (value 0) | **`0x262`** | - The throw comes from `ge_user_vgpr_en` (`PrimState.cpp:33`). - The `vgt_gs_out_prim_type` offset doesn't matter for this title: `vgt_shader_stages_en` has no GS bit, so `sceAgcCreatePrimState` computes the output primitive type from `prim_type` and never reads that special. (In the driver `0x2ce` is a different context register, the one `State.cpp:522` reads as vertices per primitive.) The title runs on the console with these headers, so the console's `sceAgcCreatePrimState` presumably 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_en` and emitted it at `GE_USER_VGPR_EN` with the title's value (0). EVO Player then gets past `sceAgcCreatePrimState` and stops later, in the shader recompiler: ``` ShaderRecompiler::Recompile: GetImageResource dword 3 is not a valid runtime value; chain: SelectU32(SLessThan32(ReadConst(GetSrtResource, Immediate), Immediate), ReadConst(GetSrtResource, ... ``` Whether `sceAgcCreatePrimState` should pass the registers through as given or normalize `ge_user_vgpr_en` to its offset is for you to decide; I haven't opened a PR for that reason. AI-assisted: yes (Claude Code).
reyani-dev commented 2026-10-11 11:25:58 +00:00 (Migrated from github.com)
Author
Contributor

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 with eboot.bin and sce_module/libc.prx unwrapped, 60 s:

Title Stop
EVO Player (PPSA99039) what(): sceAgcCreatePrimState: invalid user configuration register offsets
Jelly5 (PPSA99505) same
Emby5 (PPSA99515) same
Nuvio PS5 (PPSA99997) same

All 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 for ge_user_vgpr_en) is GE_USER_VGPR1, next to GE_USER_VGPR_EN at 0x262. With value 0 in both, a console sceAgcCreatePrimState that passes the special through without checking its offset would have the title write 0 to GE_USER_VGPR1, which wouldn't change anything. That would fit these titles running on hardware. I haven't verified it on a console.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108521830 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3457#issuecomment-6108521830). Originally posted by [reyani-dev](https://github.com/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 with `eboot.bin` and `sce_module/libc.prx` unwrapped, 60 s: | Title | Stop | |---|---| | EVO Player (PPSA99039) | `what(): sceAgcCreatePrimState: invalid user configuration register offsets` | | Jelly5 (PPSA99505) | same | | Emby5 (PPSA99515) | same | | Nuvio PS5 (PPSA99997) | same | All 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 for `ge_user_vgpr_en`) is `GE_USER_VGPR1`, next to `GE_USER_VGPR_EN` at `0x262`. With value 0 in both, a console `sceAgcCreatePrimState` that passes the special through without checking its offset would have the title write 0 to `GE_USER_VGPR1`, which wouldn't change anything. That would fit these titles running on hardware. I haven't verified it on a console.
screamm commented 2026-10-11 12:06:37 +00:00 (Migrated from github.com)
Author
Contributor

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 on main 0f863c10). 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 main the four titles that build their shader headers from EVO-PLAYER-PS5's evo_agc_shader_header.c (9ee9a542, lines 63 to 69: ge_cntl at 0x25b, vgt_shader_stages_en at 0x2d5, vgt_gs_out_prim_type at 0x2ce, ge_user_vgpr_en stored at 0x25c, GE_USER_VGPR1) stop with what(): 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.c lines 1181 to 1252 at 3c7e8072) copies all four special register pairs to the outputs as stored and never checks their offsets; KytyPS5 (agc.cpp lines 1034 to 1100 at 16a7fe68) checks them only through EXIT_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 reads GE_USER_VGPR_EN (0x262) or GE_USER_VGPR1 (0x25c). The change in Shader/src/PrimState.cpp therefore copies ge_user_vgpr_en from either shader at the offset the header stores (not moved to 0x262, nothing supports that), keeps throwing for a wrong ge_cntl, vgt_shader_stages_en or used vgt_gs_out_prim_type offset 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_helpers gains the titles' table (prim type 4) creating with ge_user_vgpr_en at 0x25c and the computed VGT_GS_OUT_PRIM_TYPE, and ge_cntl moved to 0x25c still throwing with GE_CNTL and 0x25c in the message; with the old PrimState.cpp the test fails.

Runtime check: with the rebuilt libSceAgc.prx all four titles get past sceAgcCreatePrimState and 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: DecodeRegisteredState writes the titles' vgt_gs_out_prim_type (2) into context register 0x2ce, which State.cpp reads 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 including libs: agc_shader_helpers, agc_commands, agc_initialization 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 533/534, the one failure being windows_exceptions (#3411); tools/check_conventions.py --base main and git diff --check pass. Not run on Linux.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108844830 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3457#issuecomment-6108844830). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T12:06:37Z. --- **Fix branch ready:** [`screamm:fix/agc-prim-state-user-config-offsets`](https://github.com/screamm/AnyPS5/tree/fix/agc-prim-state-user-config-offsets) (`aeaa5080`, one commit on `main` `0f863c10`). 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 `main` the four titles that build their shader headers from EVO-PLAYER-PS5's `evo_agc_shader_header.c` (`9ee9a542`, lines 63 to 69: `ge_cntl` at 0x25b, `vgt_shader_stages_en` at 0x2d5, `vgt_gs_out_prim_type` at 0x2ce, `ge_user_vgpr_en` stored at 0x25c, `GE_USER_VGPR1`) stop with `what(): 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.c` lines 1181 to 1252 at `3c7e8072`) copies all four special register pairs to the outputs as stored and never checks their offsets; KytyPS5 (`agc.cpp` lines 1034 to 1100 at `16a7fe68`) checks them only through `EXIT_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 reads `GE_USER_VGPR_EN` (0x262) or `GE_USER_VGPR1` (0x25c). The change in `Shader/src/PrimState.cpp` therefore copies `ge_user_vgpr_en` from either shader at the offset the header stores (not moved to 0x262, nothing supports that), keeps throwing for a wrong `ge_cntl`, `vgt_shader_stages_en` or used `vgt_gs_out_prim_type` offset 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_helpers` gains the titles' table (prim type 4) creating with `ge_user_vgpr_en` at 0x25c and the computed `VGT_GS_OUT_PRIM_TYPE`, and `ge_cntl` moved to 0x25c still throwing with `GE_CNTL` and `0x25c` in the message; with the old `PrimState.cpp` the test fails. Runtime check: with the rebuilt `libSceAgc.prx` all four titles get past `sceAgcCreatePrimState` and 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: `DecodeRegisteredState` writes the titles' `vgt_gs_out_prim_type` (2) into context register 0x2ce, which `State.cpp` reads 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 including `libs`: `agc_shader_helpers`, `agc_commands`, `agc_initialization` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 533/534, the one failure being `windows_exceptions` (#3411); `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
MarcZX10 commented 2026-10-11 13:33:21 +00:00 (Migrated from github.com)
Author
Contributor

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 aeaa5080 into my existing PR #3496, so the pass-through fix and its regression test can be reviewed in one PR. The PR now preserves ge_user_vgpr_en at 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109568684 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3457#issuecomment-6109568684). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T13:33:21Z. --- Thanks for sharing the implementation and the source analysis. I integrated commit [`aeaa5080`](https://github.com/screamm/AnyPS5/commit/aeaa5080d9595305aa73e74d966f989c88b79839) into my existing [PR #3496](https://github.com/boykopovar/AnyPS5/pull/3496), so the pass-through fix and its regression test can be reviewed in one PR. The PR now preserves `ge_user_vgpr_en` at 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.
LeandroLP23 commented 2026-10-11 21:33:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T21:33:07Z.


Fixed by #3496, merged in 59559c306.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114014358 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3457#issuecomment-6114014358). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-11T21:33:07Z. --- Fixed by #3496, merged in `59559c306`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3457
No description provided.