fix(libSceAgc): accept s_swappc_b64 null, s[6:7] as a front half's terminator #1124
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1124"
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 TideOPL on 2026-10-07T13:14:00Z.
What
sceAgcUnknownGetFusedShaderSize/sceAgcUnknownFuseShaderHalvesrequire a front half to end withs_setpc_b64 s[6:7](0xbe802006) before itss_code_endpadding. PPSA16064 (Minecraft Dungeons II, Unreal Engine) has front halves ending with0xbefd2106instead, so the size query threwfront half does not end with s_setpc_b64 s[6:7]on a worker thread, and rendering stopped about 6 s in.0xbefd2106is SOP1S_SWAPPC_B64(opcode0x21) with SSRC0s[6:7]and SDST 125 =NULL(RDNA2 ISA, SOP1 opcodes and the scalar operand table). It jumps tos[6:7]and discards the return address, the same transfer ass_setpc_b64 s[6:7]. Fusion drops this instruction and pads to the back half withs_nopeither way, so both forms are accepted. Any other last instruction still throws.Tested
ctest: 393/393.agc_shader_fusion: runs the full fusion check on a front half ending with thes_swappc_b64form, including that the terminator is replaced bys_noppadding. Fails onmainwith the title's error.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-08T07:55:04Z.
Checked:
0xbefd2106encodess_swappc_b64 null, s[6:7](llvm-mc gfx1030);agc_shader_fusionpasses on the merge with main and fails without theShaderFusion.cppchange; the test also checks the terminator is replaced bys_noppadding; Linux and Windows CI green. Merging.