fix(libSceAgc): match interpolant mapping variants to firmware #8402
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8402"
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 hypermoist on 2026-10-20T12:24:35Z.
What
Makes the interpolant mapping exports match the decrypted
libSceAgc.sprx.The firmware has six bodies.
sceAgcCreateInterpolantMapping(pdEV7bI6COI) is at 0x10940,sceAgcUpdateInterpolantMapping(SbuY2jN+axQ) at 0x10ca0,_0100(HV4j+E0MBHE/k0E7vkgqAuE) at 0x10f90 / 0x112a0 and_10000(dbOlWdppb4o/vieBRwlh1Lw) at 0x11540 / 0x11950. They are pure register builders onSPI_PS_INPUT_CNTL_0 + i, and they differ only in how they derive each value and in whether they fill the identity tail.sceAgcCreateInterpolantMappingandsceAgcUpdateInterpolantMapping(unversioned, absent until now). They are the_0100transform with one difference: a matched non-f16 input that is flat-shaded also gets OFFSET bit 5 (0x20), which_0100sets only foris_custom(firmware 0x10a8b–0x10aa8). Create fills the identity tail and Update does not.sceAgcUpdateInterpolantMapping_10000no longer throws for anis_f161 or 3 input whosedefault_valueanddefault_value_hidiffer. The firmware takesDEFAULT_VALfromdefault_value, which is whatCreateInterpolantValueSplitF16already does. So this export is now_10000without the tail.Null and empty handling is unchanged, and matches the firmware where the firmware does not crash:
gswith inputs, or a null pixel shader for Update, crashes on the console and throws here.Debt: the two
Update_10000OpenAGC-only entries are removed fromlibSceAgc.md. The "is_f162 bits follow KytyPS5, not confirmed" sentence is dropped from theCreate_10000entry.Not in this PR:
sceAgcUpdateInterpolantMapping_0100(stillNotImplementedinShaderFusion.cpp) is, per the firmware, the_0100transform without the tail. It will follow once #8314, which appends to the end of that file, is merged.Tested
Linux (CachyOS, GCC, Release).
libSceAgc.sprx, seeded its interpolant register template withSPI_PS_INPUT_CNTL_0, and called each of the six exports on 300 000 random pixel and geometry shaders. The shaders had 0 to 32 inputs and outputs, random semantic words and partly overlapping semantic IDs. Upstream's value helpers with the new variant selection gave 0 mismatching registers for every export, tail included.agc_interpolant_mapping_testsgainstestUnversionedMapping; the old expect-throw case intestUpdateMappingnow checks the firmware values0x01380007and0x03680409. All expected values come from the console module's output. The suite passes, as doagc_driver_interpolation_f16_testsandagc_driver_interpolation_modes_tests.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)pdEV7bI6COI/SbuY2jN+axQno longer hit a missing NID🤖 Generated with Claude Code
https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T12:25:19Z.
Progress report (
aa02422→e95f842)📈 System libraries: 64.34% (+0.01%, +2 implemented functions)
✅ 2 implemented
sceAgcCreateInterpolantMapping_nid_postfixsceAgcUpdateInterpolantMapping_nid_postfix