feat(agc): implement the interpolant mapping variant for high-half f16 inputs #651

Merged
Celegans12 merged 1 commit from upstream-pr/651 into main 2026-10-05 18:48:08 +00:00
Celegans12 commented 2026-10-05 11:12:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-05T11:12:20Z.


What

libSceAgc does not export dbOlWdppb4o, so PPSA26344's import of it does not resolve.

  • Name unknown: KytyPS5 calls it AgcCreateInterpolantMapping2, but sceAgcCreateInterpolantMapping2 recomputes to 5ucTcsliW+A and aerolib has no entry, so it is exported as sceAgcUnknownCreateInterpolantMapping, like sceAgcUnknownFuseShaderHalves. (HV4j+E0MBHE, named sceAgcCreateInterpolantMapping on main, does not recompute either; left as is.)
  • Same arguments, checks and registers as sceAgcCreateInterpolantMapping, except for inputs with only the high f16 half (is_f16 2): FP16_INTERP_MODE set, USE_DEFAULT_ATTR1 clear, DEFAULT set unless the matching gs output has the high half, DEFAULT_VAL and DEFAULT_VAL_ATTR1 from default_value_hi. This follows AgcCreateInterpolantMapping2 in KytyPS5; TechnicalDebt lists it.
  • PPSA26344 v1.008 calls it at 9 sites, including its static linkShaders (0x1612280), with a 0x100-byte register block, a Gs and a Ps shader or null, and uses all 32 registers.

sceAgcCreateInterpolantMapping, which sceAgcLinkShaders calls, now shares the checks and register loop. Its output is unchanged for 1 to 32 inputs (500,000 random gs/ps sets against main: no difference). More than 32 inputs now throw instead of writing past the 32-register block; sceAgcLinkShaders already rejects such shaders.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main 53dc19cf: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 285/285 tests pass (ctest --output-on-failure)
  • New agc_interpolant_mapping: high-half rows (gs half present, missing, unmatched), both exports equal outside mode 2, 33 inputs rejected without writes, null gs/regs. Does not link on main (undefined sceAgcUnknownCreateInterpolantMapping); fails with mode 2 mapped like sceAgcCreateInterpolantMapping.
  • PPSA26344 v1.008: on main the dbOlWdppb4o import is unresolved at load; with this change it resolves.
  • Not tested: Linux (CI), PPSA21564, rendering of f16 interpolants, console behaviour.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4744017321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/651). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-05T11:12:20Z. --- ### What libSceAgc does not export `dbOlWdppb4o`, so PPSA26344's import of it does not resolve. - Name unknown: KytyPS5 calls it `AgcCreateInterpolantMapping2`, but `sceAgcCreateInterpolantMapping2` recomputes to `5ucTcsliW+A` and aerolib has no entry, so it is exported as `sceAgcUnknownCreateInterpolantMapping`, like `sceAgcUnknownFuseShaderHalves`. (`HV4j+E0MBHE`, named `sceAgcCreateInterpolantMapping` on `main`, does not recompute either; left as is.) - Same arguments, checks and registers as `sceAgcCreateInterpolantMapping`, except for inputs with only the high f16 half (`is_f16` 2): FP16_INTERP_MODE set, USE_DEFAULT_ATTR1 clear, DEFAULT set unless the matching gs output has the high half, DEFAULT_VAL and DEFAULT_VAL_ATTR1 from `default_value_hi`. This follows `AgcCreateInterpolantMapping2` in [KytyPS5](https://github.com/KytyPS5/KytyPS5); TechnicalDebt lists it. - PPSA26344 v1.008 calls it at 9 sites, including its static `linkShaders` (0x1612280), with a 0x100-byte register block, a Gs and a Ps shader or null, and uses all 32 registers. `sceAgcCreateInterpolantMapping`, which `sceAgcLinkShaders` calls, now shares the checks and register loop. Its output is unchanged for 1 to 32 inputs (500,000 random gs/ps sets against `main`: no difference). More than 32 inputs now throw instead of writing past the 32-register block; `sceAgcLinkShaders` already rejects such shaders. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0, based on `main` 53dc19cf: configure `-DBUILD_TESTING=ON`, full build, `--target libs`, `ctest`: - 285/285 tests pass (`ctest --output-on-failure`) - New `agc_interpolant_mapping`: high-half rows (gs half present, missing, unmatched), both exports equal outside mode 2, 33 inputs rejected without writes, null `gs`/`regs`. Does not link on `main` (undefined `sceAgcUnknownCreateInterpolantMapping`); fails with mode 2 mapped like `sceAgcCreateInterpolantMapping`. - PPSA26344 v1.008: on `main` the `dbOlWdppb4o` import is unresolved at load; with this change it resolves. - Not tested: Linux (CI), PPSA21564, rendering of f16 interpolants, console behaviour. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-05 15:55:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T15:55:39Z.


Progress report (e248f40 → 5e851fb)

📈 System libraries: 79.21% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAgc sceAgcUnknownCreateInterpolantMapping
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5998083884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/651#issuecomment-5998083884). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-05T15:55:39Z. --- <!-- progress-report --> ### Progress report (e248f40 → 5e851fb) 📈 **System libraries**: 79.21% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcUnknownCreateInterpolantMapping` | </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!651
No description provided.