AGC: registering a compute shader header without specials throws (ps5-opengl, PPSA99005) #2580
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 AlxcBTW on 2026-10-10T06:50:32Z.
PPSA99005 (ps5-opengl showcase) stops at
AGC driver: shader metadata is outside the registered headerwhen it registers its compute shaders.Cause
A registered compute shader takes its wave size from its header's specials (
dispatch_modifier), andPrepareRegisteredreads 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)insrc/platform/ps5_agc_runtime_backend.c. The specials pointer is 0, so registration throws.Fix
AlxcBTW:fix/agc-compute-without-specials-v2(d5655a45, onmaind5c8e42d). It now usesmain's deferred preparation (52b77c20) instead of its own dispatch path. InPrepareRegistered, a compute header without specials callsdefer("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'sCS_W32_EN. The change is 4 lines plus a test. In full CI, Linux and macOS pass. The only Windows failure isagc_driver_prepared_shaders_deferred_undecodable, which currently fails on everymainrun (#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_shadersgainsRegistrationWithoutSpecials. It registers a compute header without specials and dispatches it with initiators0x8041(wave32) and0x41(wave64). Without the change the test fails withshader metadata is outside the registered header. With it, the test passes.ctest -R ^agcond5c8e42d: all pass exceptagc_driver_f32_arithmetic_nan, which fails the same way without the change on this NVIDIA GPU.ready GL=4.6 (Core Profile) Mesa 26.2.0. The full chain is in #2026. I haven't rerun the showcase on this version yet.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-10T08:29:57Z.
Windows/AMD data point: this is ps5-opengl's (PPSA99005 v1.0.1) next stop on Windows once its missing imports are present. On
main89a1fb4eit 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.
81a5a1a0 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.Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-10T08:33:34Z.
@LeandroLP23 thanks for the AMD run. 81a5a1a0 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.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-10T08:51:53Z.
@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) onmainc5d77d6bwith #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.