fix(agc): accept unaligned shader headers #902
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/902"
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 Celegans12 on 2026-10-06T14:49:56Z.
What
On
main,Driver::RegisterShader(called bysceAgcCreateShader) throwsAGC driver: null or misaligned addressfor a shader header that is not 8-byte aligned; PPSA26344 v1.008 passes such headers.memcpy; the code must still be 256-byte aligned._readHeaderPod,RequestMemoryView) and need no change..xppspack's data section in place at an aligned base (all_shaders.xppsat 0x8000000000); its compute objects hold a header pointer at +0x30 and a code pointer at +0x38 forsceAgcCreateShader(eboot 0xab5133). Incore_common_subcore.core_b1_fx.sprig.xpps, 16 compute headers sit 4 bytes and 16 sit 1 byte past an 8-byte boundary; the run stopped at the first, 0x801e374cc4 = 0x801e200000 + 0x174cc4.sceAgcCbSetShRegistersDirectneeds a 4-byte aligned register list; the 1 mod 8 headers' lists sit at 1 mod 4 (eboot 0xab4412 passessh_registers). No public source states the console's rule (TechnicalDebt).alignof(Shader)check to its new entry points in this file; the second to land should use one rule.Tested
main148b888c: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 375/375 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver: newtestShaderHeaderAlignmentregisters headers 0, 4 and 1 bytes past an 8-byte boundary and checks the refusals (null, unreadable, misaligned code, wrong version, short header); it fails onmainwithAGC driver: null or misaligned address.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T16:27:44Z.
Checked on Linux on top of current main: build and full ctest green,
agc_driverfails on main withnull or misaligned addressand passes with the change; the misaligned-code, version and short-header refusals still throw. The pr-overlap hit on #1128 is the repo-wide clang-format change, not a real overlap. Merging.