You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AGC: registering a compute shader header without specials throws (ps5-opengl, PPSA99005) #2580
PPSA99005 (ps5-opengl showcase) stops at AGC driver: shader metadata is outside the registered header when it registers its compute shaders.
Cause
A registered compute shader takes its wave size from its header's specials (dispatch_modifier), and PrepareRegistered reads them without a null check. ps5-opengl registers compute headers without specials, because it only writes the specials pointer at +40 for linked graphics stages. It passes the wave size in the dispatch initiator instead: sceAgcCbDispatch(..., m->compute_wave_size == 32 ? 0x8000 : 0) in src/platform/ps5_agc_runtime_backend.c. The specials pointer is 0, so registration throws.
Fix
AlxcBTW:fix/agc-compute-without-specials-v2 (d5655a45, on maind5c8e42). It now uses main's deferred preparation (52b77c2) instead of its own dispatch path. In PrepareRegistered, a compute header without specials calls defer("its header has no specials to give its wave size"), so the shader is prepared at its first dispatch with the wave size from the initiator's CS_W32_EN. The change is 4 lines plus a test. In full CI, Linux and macOS pass. The only Windows failure is agc_driver_prepared_shaders_deferred_undecodable, which currently fails on every main run (#2606). I can't open it as a PR while intake is limited, so it's here if a collaborator wants to cherry-pick it.
Tested
Windows 11, WinLibs GCC 15.2.0 r7.
agc_driver_prepared_shaders gains RegistrationWithoutSpecials. It registers a compute header without specials and dispatches it with initiators 0x8041 (wave32) and 0x41 (wave64). Without the change the test fails with shader metadata is outside the registered header. With it, the test passes. ctest -R ^agc on d5c8e42: all pass except agc_driver_f32_arithmetic_nan, which fails the same way without the change on this NVIDIA GPU.
Windows/AMD data point: this is ps5-opengl's (PPSA99005 v1.0.1) next stop on Windows once its missing imports are present. On main89a1fb4 it stops at _umtx_op; with #1482 (_umtx_op), the #2106 rebase (pthread_sigmask) and #1872 (pthread_set_name_np) merged on top, it loads, opens video out ([ps5-agc] present-open handle=00000001 ... buffers=2) and stops with:
terminate called after throwing an instance of 'std::runtime_error'
what(): AGC driver: shader metadata is outside the registered header
81a5a1a doesn't apply to current main any more: ShaderRegistry.cpp has been reworked since (background preparation in #2583, deferred undecodable shaders, the null pixel program prepared at use), and the conflict is in the same function the fix changes (PreparedAtDispatch against main's PreparedAtUse). I didn't rebase it, since it needs to be redone on the new code rather than merged.
@LeandroLP23 thanks for the AMD run. 81a5a1a was the first version. The fix linked in the issue is the redone one, d5655a45 (AlxcBTW/AnyPS5#10): it uses main's deferred preparation (defer("its header has no specials to give its wave size")) instead of its own dispatch path. Dean carries it in #2627. If you can run the showcase with #2627 on top, that would show whether it gets past registration on AMD too.
@AlxcBTW thanks, I had picked up the first version. With #2627 (f752ef4f) it gets past registration on AMD too. ps5-opengl (PPSA99005 v1.0.1) on mainc5d77d6 with #2627, #1482 (_umtx_op), the #2106 rebase (pthread_sigmask), #1872 (pthread_set_name_np) and your #2577/#2578 fixes on top (both merged since, as #2625 and #2626):
the compute headers without specials are deferred: Shader 0x21f3d9000 could not be prepared at registration (its header has no specials to give its wave size); preparing it when it is used
it then stops at its first draw's shader, on a recompiler gap rather than anything in this fix: v_fma_mixlo/mixhi_f16 at pc 884 in FLOAT_MODE 204 (f16 denormals not kept or rounding not to nearest even) is not implemented
Activity
LeandroLP23 commentedon Oct 10, 2026
Windows/AMD data point: this is ps5-opengl's (PPSA99005 v1.0.1) next stop on Windows once its missing imports are present. On
main89a1fb4 it stops at_umtx_op; with #1482 (_umtx_op), the #2106 rebase (pthread_sigmask) and #1872 (pthread_set_name_np) merged on top, it loads, opens video out ([ps5-agc] present-open handle=00000001 ... buffers=2) and stops with:Radeon 860M (RDNA 3.5), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release.
81a5a1a doesn't apply to current
mainany more:ShaderRegistry.cpphas been reworked since (background preparation in #2583, deferred undecodable shaders, the null pixel program prepared at use), and the conflict is in the same function the fix changes (PreparedAtDispatchagainstmain'sPreparedAtUse). I didn't rebase it, since it needs to be redone on the new code rather than merged.AlxcBTW commentedon Oct 10, 2026
@LeandroLP23 thanks for the AMD run. 81a5a1a was the first version. The fix linked in the issue is the redone one,
d5655a45(AlxcBTW/AnyPS5#10): it usesmain's deferred preparation (defer("its header has no specials to give its wave size")) instead of its own dispatch path. Dean carries it in #2627. If you can run the showcase with #2627 on top, that would show whether it gets past registration on AMD too.LeandroLP23 commentedon Oct 10, 2026
@AlxcBTW thanks, I had picked up the first version. With #2627 (
f752ef4f) it gets past registration on AMD too. ps5-opengl (PPSA99005 v1.0.1) onmainc5d77d6 with #2627, #1482 (_umtx_op), the #2106 rebase (pthread_sigmask), #1872 (pthread_set_name_np) and your #2577/#2578 fixes on top (both merged since, as #2625 and #2626):Shader 0x21f3d9000 could not be prepared at registration (its header has no specials to give its wave size); preparing it when it is used[ps5-gl46-showcase] ready GL=4.6 (Core Profile) Mesa 26.2.0 GLSL=4.60 size=3840x2160 particles=262144 instances=8192v_fma_mixlo/mixhi_f16 at pc 884 in FLOAT_MODE 204 (f16 denormals not kept or rounding not to nearest even) is not implementedRadeon 860M (RDNA 3.5), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release.