fix(agc): make sceAgcCreateShader idempotent #18651
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18651"
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 DealPotato on 2026-11-12T00:00:37Z.
What
A title may call
sceAgcCreateShaderagain on a header it already created. The second call resolved the relative pointers again and added the code base to the program address registers a second time. WWE 2K26 (PPSA34299) does this in its main menu and crashed on the corrupted pointers.A header whose code pointer is already set keeps its resolved pointers, and its program address is rebased from the previous code address onto the new one.
Tested
Windows 11 Pro (build 26300), NVIDIA GeForce RTX 4070, driver 610.88. Focused tests run with
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -Vonmain(3a0a54bbd8) and on this change, from one build directory; the loader inserted the validation layer in both runs.Passed on
mainand on the change:agc_create_shader. Neither log has aVUID-message. The build also held four other fixes for the same title on other code; two of them are opened as pull requests next to this one.The new
agc_create_shadercase creates a pixel shader twice from one header (pointers and program address unchanged) and a third time from other code (program address rebased onto it). WWE 2K26 reaches its menus with the change on theps5/wwe2k26work branch.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T00:38:38Z.
Review: APPROVED
Reviewed — looks good
The repeated call now leaves already-resolved header pointers intact and rebases the shader-program register pair from the previous code base to the new one; the focused regression covers both same-code and moved-code calls.
What I ran
Head
cbfcb7c2ec94fa31b381547eafcacaf85c16cbe8; base6183766a30d705f318e2479bd47b392da26353c5. Environment: Debian 12, Python 3.11.2, GCC 12.2.0.The PR description reports
agc_create_shaderpassing on Windows 11 with an RTX 4070 and Vulkan validation enabled, on both main and this change. It also reports WWE 2K26 reaching its menus on a work branch containing this PR; I did not run either test locally.Results
agc_create_shader; not run locally.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
To get this to a good state
No follow-up is required for the reviewed head.