Registering a shader of type 8 aborts the title: "AGC driver: unsupported registered shader type" #1892

Closed
opened 2026-10-08 22:51:18 +00:00 by fisherjoey · 0 comments
fisherjoey commented 2026-10-08 22:51:18 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T22:51:18Z.


Stray (PPSA02100 v1.05, Unreal Engine 4) aborts during start-up, before its first frame:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC driver: unsupported registered shader type

Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is main 1be6f9f1 + #861 + #1836. Without #1836 the title stops earlier, on #1817.

The throw comes from the switch (snapshot.type) in PrepareRegistered (ShaderRegistry.cpp), which knows types 0, 1, 2, 4, 5, 6 and 7. Since #639, every registered shader goes through it in RegisterShader. Stray registers 13 shaders of type 8. With APS5_TRACE_SHADER_REGS=all, the counts by type over one start-up are 0: 1626, 1: 1067, 2: 100, 4: 3, 6: 4 and 8: 13. One of them:

[shader] 0x200e020000 type 8 cx sh 0=00001218 1=40104004 2=000000a0 5=00000000 3=00000006 4=0000000c 6=00000000 7=00000000

The type 8 headers have no context registers, and their sh registers use offsets 0 to 7, which are not SPI_SHADER_PGM_* registers. So there's no program address to read and no stage to map them to. The draw path only builds programs for types 1, 2, 4, 5, 6 and 7 (DrawDecode.cpp:37 checks the type), and compute is type 0. Nothing in the driver can run a type 8 shader. The only effect of the throw is that start-up stops.

Fix: at registration, log the type and skip preparing an unsupported type. Any later attempt to prepare it still throws, and the message now includes the type number. The PR has a test that registers a type 8 header shaped like Stray's. It fails on main and passes with the fix.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5770027681 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1892). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T22:51:18Z. --- Stray (PPSA02100 v1.05, Unreal Engine 4) aborts during start-up, before its first frame: ``` terminate called after throwing an instance of 'std::runtime_error' what(): AGC driver: unsupported registered shader type ``` Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is `main` 1be6f9f1 + #861 + #1836. Without #1836 the title stops earlier, on #1817. The throw comes from the `switch (snapshot.type)` in `PrepareRegistered` (`ShaderRegistry.cpp`), which knows types 0, 1, 2, 4, 5, 6 and 7. Since #639, every registered shader goes through it in `RegisterShader`. Stray registers 13 shaders of type 8. With `APS5_TRACE_SHADER_REGS=all`, the counts by type over one start-up are 0: 1626, 1: 1067, 2: 100, 4: 3, 6: 4 and 8: 13. One of them: ``` [shader] 0x200e020000 type 8 cx sh 0=00001218 1=40104004 2=000000a0 5=00000000 3=00000006 4=0000000c 6=00000000 7=00000000 ``` The type 8 headers have no context registers, and their sh registers use offsets 0 to 7, which are not `SPI_SHADER_PGM_*` registers. So there's no program address to read and no stage to map them to. The draw path only builds programs for types 1, 2, 4, 5, 6 and 7 (`DrawDecode.cpp:37` checks the type), and compute is type 0. Nothing in the driver can run a type 8 shader. The only effect of the throw is that start-up stops. Fix: at registration, log the type and skip preparing an unsupported type. Any later attempt to prepare it still throws, and the message now includes the type number. The PR has a test that registers a type 8 header shaped like Stray's. It fails on `main` and passes with the fix. AI-assisted: yes
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#1892
No description provided.