feat(libSceFreeType): implement FT_Library_SetLcdFilter and FT_Library_SetLcdFilterWeights #10582

Merged
MarcZX10 merged 13 commits from upstream-pr/10582 into main 2026-11-05 23:52:26 +00:00
MarcZX10 commented 2026-10-24 11:12:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:12:44Z.


What

Adds FT_Library_SetLcdFilter and FT_Library_SetLcdFilterWeights to libSceFreeType, forwarding to the bundled FreeType 2.13.3 through the guest library. The bundled build has FT_CONFIG_OPTION_SUBPIXEL_RENDERING off, so both return FT_Err_Unimplemented_Feature as in ftlcdfil.c and no filter takes effect. The five weights are read from the guest buffer through GuestArenaPrepareHostRead_nid_no_patch and copied before the call. Whether the console library enables subpixel rendering and its signatures are unverified; the debt entry says so.

Commits: for each function in turn (FT_Library_SetLcdFilter, then FT_Library_SetLcdFilterWeights), the implementation, its test and its debt entry.

Tested

Linux x86-64, GCC, full CMake build (Ninja, Release). guest_freetype_lcd_filter compares the return code of each call with the native API for every filter value including FT_LCD_FILTER_MAX, -1 and 99, for valid and null weights, and for a null library. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test with that check disabled in a local, uncommitted edit; it exits 0. tools/check_conventions.py and git diff --check pass. No title or GPU involved.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4994895531 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10582). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T11:12:44Z. --- ### What Adds `FT_Library_SetLcdFilter` and `FT_Library_SetLcdFilterWeights` to libSceFreeType, forwarding to the bundled FreeType 2.13.3 through the guest library. The bundled build has `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` off, so both return `FT_Err_Unimplemented_Feature` as in [ftlcdfil.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftlcdfil.c) and no filter takes effect. The five weights are read from the guest buffer through `GuestArenaPrepareHostRead_nid_no_patch` and copied before the call. Whether the console library enables subpixel rendering and its signatures are unverified; the debt entry says so. Commits: for each function in turn (`FT_Library_SetLcdFilter`, then `FT_Library_SetLcdFilterWeights`), the implementation, its test and its debt entry. ### Tested Linux x86-64, GCC, full CMake build (Ninja, Release). `guest_freetype_lcd_filter` compares the return code of each call with the native API for every filter value including `FT_LCD_FILTER_MAX`, `-1` and `99`, for valid and null weights, and for a null library. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test with that check disabled in a local, uncommitted edit; it exits 0. `tools/check_conventions.py` and `git diff --check` pass. No title or GPU involved. ### Checklist - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 04:57:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:57:37Z.

Review: COMMENTED


Reviewed — debt-file requests still open at this head

The duplicate debt entry and the 129 count the reviewer asked to change are both still in the file at a8f5479fea.

What I ran

  • Live head a8f5479fea3481d09be83db2efefabb5f11f61aa (matches batch).
  • gh pr view 10582 (headRefOid, mergeable, statusCheckRollup); gh api GET of comments and reviews newer than 2026-10-27T10:47:16Z.
  • git show of docs/dev/debt/libSceFreeTypeOt.md at the head; git show of core/libs/prx/libSceFreeTypeOt/Export.cpp at the head, with a grep count.
  • Nothing was built or run.

Results

Check Result Note
eligibility, conventions, labels, report SUCCESS hosted
windows SUCCESS hosted
relinker, relinker-asan, register-context, write-watch SKIPPED hosted
linux SKIPPED hosted
merge state CLEAN hosted

Findings

  • oneandonlydean (2026-10-28T14:57:41Z, and 2026-10-29T05:51:29Z): fold FT_Library_SetLcdFilter and FT_Library_SetLcdFilterWeights into main's identified-NID entry and remove the duplicate.
    • Not done. Debt doc line 3 is a separate entry that now lists the LCD names. Line 4 is main's entry, with the eight shared names and the FT_Stroker names, and no LCD names. The eight shared names appear twice.
    • Verified by reading.
  • Count (2026-10-29T05:51:29Z): asks that the count match the source. Line 5 still says 129. Export.cpp has 122 sceFreeTypeOtUnknown_* definitions at this head (grep count of definition lines). Not done.

Sources

Not verified

  • The count of 122 is from a grep of the file; not compared with main 52c09d567d.
  • No build.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732250111 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10582#pullrequestreview-5732250111). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:57:37Z. **Review:** COMMENTED --- # Reviewed — debt-file requests still open at this head The duplicate debt entry and the 129 count the reviewer asked to change are both still in the file at a8f5479fea. ## What I ran - Live head a8f5479fea3481d09be83db2efefabb5f11f61aa (matches batch). - gh pr view 10582 (headRefOid, mergeable, statusCheckRollup); gh api GET of comments and reviews newer than 2026-10-27T10:47:16Z. - git show of docs/dev/debt/libSceFreeTypeOt.md at the head; git show of core/libs/prx/libSceFreeTypeOt/Export.cpp at the head, with a grep count. - Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | eligibility, conventions, labels, report | SUCCESS | hosted | | windows | SUCCESS | hosted | | relinker, relinker-asan, register-context, write-watch | SKIPPED | hosted | | linux | SKIPPED | hosted | | merge state | CLEAN | hosted | ## Findings - oneandonlydean (2026-10-28T14:57:41Z, and 2026-10-29T05:51:29Z): fold FT_Library_SetLcdFilter and FT_Library_SetLcdFilterWeights into main's identified-NID entry and remove the duplicate. - Not done. Debt doc line 3 is a separate entry that now lists the LCD names. Line 4 is main's entry, with the eight shared names and the FT_Stroker names, and no LCD names. The eight shared names appear twice. - Verified by reading. - Count (2026-10-29T05:51:29Z): asks that the count match the source. Line 5 still says 129. Export.cpp has 122 sceFreeTypeOtUnknown_* definitions at this head (grep count of definition lines). Not done. ## Sources - https://github.com/boykopovar/AnyPS5/blob/a8f5479fea3481d09be83db2efefabb5f11f61aa/docs/dev/debt/libSceFreeTypeOt.md#L3-L5 - https://github.com/boykopovar/AnyPS5/blob/a8f5479fea3481d09be83db2efefabb5f11f61aa/core/libs/prx/libSceFreeTypeOt/Export.cpp#L1-L10 ## Not verified - The count of 122 is from a grep of the file; not compared with main 52c09d567d. - No build.
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!10582
No description provided.