Skip to content

feat(libSceFreeTypeOt): forward renderer selection - #19415

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
THEMANnt:feat/freetype-ot-select-renderer
Nov 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
THEMANnt:feat/freetype-ot-select-renderer

Conversation

@THEMANnt

@THEMANnt THEMANnt commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement libSceFreeTypeOt NID Yu9oXRVmTTo by forwarding FT_Set_Renderer to libSceFreeType. This lets callers use renderers returned by the existing guest module lookup and shares the guest parameter conversion.

Tested

Windows (GCC 15.2.0 MinGW, Ninja, Release) on e50198993f. Both guest_freetype_ot and guest_freetype_ot_patched passed. The patched test creates a guest library, obtains the smooth renderer from the existing module lookup and selects it through the NID. It also compares missing-renderer and missing-library errors with the native backend. Conventions and diff checks passed. The overlap tool hit a GitHub API EOF. Exact-name searches and inspection of #16122 found no competing implementation.

Review follow-up on 5aeebb6d88. Both Ot wrappers use C linkage and call uniquely named libSceFreeType adapters. The raw and patched guest_freetype_ot tests now resolve the Ot exports on both platforms. Both tests passed three consecutive runs on Ubuntu 24.04.5 (GCC 13.3, Release, WSL2) and Windows (GCC 15.2, Release). The patched Ot module defines 4RRjK-Wd1lU and Yu9oXRVmTTo on both platforms.

Rebased in 6fabc0e0ab as a standalone renderer-selection change. The renderer wrapper retains C linkage and calls the uniquely named adapter. The raw and patched Ot tests each passed three consecutive runs on Windows.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

@JJenkx

JJenkx commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Windows check of head e50198993f, merged onto main 839e22e4e6 (ab1f4bac1a, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • guest_freetype_ot, guest_freetype_ot_patched pass in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 10897 core/libs/prx/libSceFreeType/include/Api.hpp
core/libs/prx/libSceFreeTypeOt/Export.cpp
PR 16823 core/libs/prx/libSceFreeTypeOt/Export.cpp
PR 17776 core/libs/prx/libSceFreeType/include/Api.hpp
core/libs/prx/libSceFreeTypeOt/Export.cpp
core/libs/tests/GuestFreeTypeOt.cpp
PR 21990 core/libs/prx/libSceFreeType/include/Api.hpp
core/libs/prx/libSceFreeTypeOt/Export.cpp

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Progress report (c825105 → 428b7db)

📈 System libraries: 41.85% (+0.0025%, +1 implemented function)

✅ 1 implemented
Library Name
libSceFreeTypeOt sceFreeTypeOtSetRenderer_nid_no_patch

Changed libraries (implemented exports)

Library Before After Change
libSceFreeTypeOt 146/199 (73.37%) 147/199 (73.87%) +0.50%

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 13, 2026
@THEMANnt
THEMANnt force-pushed the feat/freetype-ot-select-renderer branch 2 times, most recently from 33175a7 to 12505d7 Compare November 13, 2026 18:52
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@THEMANnt I reviewed 57dd6fc. The renderer forwarding itself reads fine, but moving sceFreeTypeOtSetRenderer_nid_no_patch and sceFreeTypeOtOutlineGetBitmap_nid_no_patch out of the extern "C" block in Export.cpp breaks their NID exports.

APS5_EXPORT aliases the unmangled function name (.set "<NID>_nid_no_patch_cut", <function>). Outside extern "C" the function is only emitted as its mangled _Z... name, so the alias points at a symbol that does not exist. I checked this with a small g++ -shared case: the function inside extern "C" exports AAA_nid_no_patch_cut, the same function outside it exports only _Z4outCi and leaves outC undefined. So Yu9oXRVmTTo would not be exported by libSceFreeTypeOt, and 4RRjK-Wd1lU, which works on main today, would regress. The Unix test now resolves FT_Set_Renderer_nid_postfix and FT_Outline_Get_Bitmap_nid_postfix from libSceFreeType, so it passes without ever touching the Ot exports.

Please:

  1. Keep both functions inside the extern "C" block and put the new sceFreeTypeOtSetRenderer_nid_no_patch body there, in place of the throwing stub.
  2. Make the test resolve the Ot exports by their sceFreeTypeOt..._nid_no_patch names on every platform, as main does.
  3. In docs/dev/debt/libSceFreeTypeOt.md, remove FT_Set_Renderer from the existing throwing list instead of adding a second list, so the doc does not say it both forwards and throws.

If you have an nm -D listing showing the NID aliases exported with your current layout, send it and I will look again.

@THEMANnt
THEMANnt force-pushed the feat/freetype-ot-select-renderer branch from 57dd6fc to 5aeebb6 Compare November 13, 2026 19:27
@THEMANnt

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Thanks for catching this. In 5aeebb6d88 both wrappers are back in the extern "C" block, and the tests resolve the Ot exports in both raw and patched mode on Linux and Windows. The wrappers call uniquely named libSceFreeType adapters to avoid the Linux self-resolution loop. I also removed FT_Set_Renderer from the throwing list.

nm -D --defined-only on the patched Linux libSceFreeTypeOt.prx shows:

0000000000007540 T 4RRjK-Wd1lU
0000000000007690 T Yu9oXRVmTTo

Both raw and patched tests passed three runs each on Ubuntu 24.04.5 (GCC 13.3, Release, WSL2) and Windows (GCC 15.2, Release). Could you take another look at the updated head?

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 13, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 14, 2026
@THEMANnt

Copy link
Copy Markdown
Contributor Author

The bitmap fix is now in #20047. I’ve prepared and tested the rebase locally on Linux and Windows. I’ll push it once #20047 lands on main, then share the new commit for retesting.

@THEMANnt

Copy link
Copy Markdown
Contributor Author

@oneandonlydean The conflict is resolved in 6fabc0e0ab. This branch now contains only renderer selection and can be reviewed independently of #20047. The renderer wrapper is still inside extern "C" and calls the uniquely named libSceFreeType adapter. The raw and patched Ot tests each passed three consecutive runs on Windows.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 15, 2026
@THEMANnt
THEMANnt force-pushed the feat/freetype-ot-select-renderer branch from 6fabc0e to 2cc9bdb Compare November 15, 2026 20:57
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 15, 2026
@THEMANnt
THEMANnt force-pushed the feat/freetype-ot-select-renderer branch from 2cc9bdb to e922ef8 Compare November 16, 2026 05:37
@THEMANnt

Copy link
Copy Markdown
Contributor Author

The Windows build completed on e922ef8efd. guest_freetype_ot, guest_freetype_ot_patched, and the previously failing audio_out2_port_layouts test passed. The only failing test was patched_libraries. Windows reported LoadLibraryEx error 127 for libSceGnmDriver.prx and libSceVideoOut.prx. The same test failed with the same two loader errors on unmodified main at 0694c4cbd6.

The newer main run is queued. Once patched_libraries passes there, this PR can get a fresh Windows check.

PR Windows log · Main Windows log · Newer main run

@THEMANnt
THEMANnt force-pushed the feat/freetype-ot-select-renderer branch from e922ef8 to 428b7db Compare November 17, 2026 11:16
@oneandonlydean
oneandonlydean merged commit 0fb15dd into boykopovar:main Nov 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants