Skip to content

feat(libSceGnmDriver): export the 19 remaining NeoMode-only imports - #18558

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Ethan-Hainline:feat/gnm-remaining-neomode-imports
Nov 13, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Ethan-Hainline:feat/gnm-remaining-neomode-imports

Conversation

@Ethan-Hainline

Copy link
Copy Markdown
Contributor

What

inFAMOUS Second Son (CUSA00223 01.07) imports 85 functions from libSceGnmDriver; 47 of them are exported only by libSceGnmDriverForNeoMode, which the title does not load (#17581). Eight open PRs (#17711, #18251, #18235, #18212, #17942, #18216, #18217, #18209) add 28 of the 47 to libSceGnmDriver. This PR adds the remaining 19:

  • sceGnmSetEmbeddedPsShader and sceGnmSetEmbeddedVsShader — the real embedded-shader producers, reusing GnmNeo::BlackPs, GnmNeo::DepthOnlyPs and GnmNeo::FullscreenVs from libSceGnmDriverForNeoMode/include/EmbeddedShaders.hpp.
  • 17 imports that are documented throwing stubs in libSceGnmDriverForNeoMode: sceGnmDestroyWorkloadStream, sceGnmDingDongForWorkload, sceGnmDrawIndexMultiInstanced, sceGnmDrawOpaqueAuto, sceGnmGetGpuBlockStatus, sceGnmGetGpuInfoStatus, sceGnmGetLastWaitedAddress, sceGnmGetNumTcaUnits, sceGnmGetProtectionFaultTimeStamp, sceGnmGetShaderProgramBaseAddress, sceGnmGetShaderStatus, sceGnmInsertThreadTraceMarker, sceGnmMapComputeQueueWithPriority, sceGnmRequestFlipAndSubmitDoneForWorkload, sceGnmSetWaveLimitMultipliers, sceGnmSubmitAndFlipCommandBuffersForWorkload and sceGnmSubmitCommandBuffersForWorkload.

Both libraries now export the same NIDs, so the new declarations use the repository's _nid_disambig1 suffix. The NID patcher strips it before hashing: tools/nid_names.compute_nid on each base name matches the NID in #17581's table (for example sceGnmSetEmbeddedPsShader → X9Omw9dwv5M, sceGnmSetEmbeddedVsShader → +AFvOEXrKJk, sceGnmSubmitCommandBuffersForWorkload → jRcI8VcgTz4).

The 17 stubs are recorded in docs/dev/debt/libSceGnmDriver.md. They resolve the imports so the title can load; calling one still throws until its console behavior is measured.

Tested

Windows 11 Pro 10.0.26300, Ryzen 5 7530U, WinLibs GCC 16.2.0 UCRT, Release, BUILD_TESTING=ON:

  • guest_gnm_driver — 3/3 passed, including new checks for both embedded shaders (packet shape, shader-id refusal and null-buffer refusal).
  • public_headers — passed (the _nid_disambig1 declarations keep one declaration per export name).
  • nid_patcher --write-export-list on the built libSceGnmDriver.prx lists all 19 new names.
  • python tools/check_conventions.py --base upstream/main and git diff --check pass.

Not tested: the title itself (no CUSA00223 dump here), and the 17 stubs have no behavior beyond resolving the imports.

Checklist

@github-actions

Copy link
Copy Markdown

Progress report (c528d49 → a11cc65)

📉 System libraries: 37.57% (-0.02%, +2 implemented, +17 declared functions)

✅ 2 implemented
Library Name
libSceGnmDriver sceGnmSetEmbeddedPsShader_nid_disambig1
libSceGnmDriver sceGnmSetEmbeddedVsShader_nid_disambig1
🆕 17 declared as stubs
Library Name
libSceGnmDriver sceGnmDestroyWorkloadStream_nid_disambig1
libSceGnmDriver sceGnmDingDongForWorkload_nid_disambig1
libSceGnmDriver sceGnmDrawIndexMultiInstanced_nid_disambig1
libSceGnmDriver sceGnmDrawOpaqueAuto_nid_disambig1
libSceGnmDriver sceGnmGetGpuBlockStatus_nid_disambig1
libSceGnmDriver sceGnmGetGpuInfoStatus_nid_disambig1
libSceGnmDriver sceGnmGetLastWaitedAddress_nid_disambig1
libSceGnmDriver sceGnmGetNumTcaUnits_nid_disambig1
libSceGnmDriver sceGnmGetProtectionFaultTimeStamp_nid_disambig1
libSceGnmDriver sceGnmGetShaderProgramBaseAddress_nid_disambig1
libSceGnmDriver sceGnmGetShaderStatus_nid_disambig1
libSceGnmDriver sceGnmInsertThreadTraceMarker_nid_disambig1
libSceGnmDriver sceGnmMapComputeQueueWithPriority_nid_disambig1
libSceGnmDriver sceGnmRequestFlipAndSubmitDoneForWorkload_nid_disambig1
libSceGnmDriver sceGnmSetWaveLimitMultipliers_nid_disambig1
libSceGnmDriver sceGnmSubmitAndFlipCommandBuffersForWorkload_nid_disambig1
libSceGnmDriver sceGnmSubmitCommandBuffersForWorkload_nid_disambig1

Changed libraries (implemented exports)

Library Before After Change
libSceGnmDriver 30/45 (66.67%) 32/64 (50.00%) -16.67%

@JJenkx

JJenkx commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Windows check of head a11cc6572e, merged onto main 1643b70e0f (2b5bcd2541, 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_gnm_driver passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 16238 sceGnmDestroyWorkloadStream
sceGnmDingDongForWorkload
sceGnmDrawIndexMultiInstanced
sceGnmDrawOpaqueAuto
sceGnmMapComputeQueueWithPriority
sceGnmRequestFlipAndSubmitDoneForWorkload
sceGnmSetWaveLimitMultipliers
sceGnmSubmitAndFlipCommandBuffersForWorkload
sceGnmSubmitCommandBuffersForWorkload
PR 17942 core/libs/prx/libSceGnmDriver/Export.cpp L21
PR 18212 core/libs/prx/libSceGnmDriver/Export.cpp L21
core/libs/tests/GuestGnmDriver.cpp L140
PR 18217 core/libs/prx/libSceGnmDriver/Export.cpp L21
PR 18546 core/libs/prx/libSceGnmDriver/include/Api.hpp L52

Exports with a name or library/NID already present in main:

  • sceGnmDestroyWorkloadStream (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmDingDongForWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmDrawIndexMultiInstanced (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmDrawOpaqueAuto (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetGpuBlockStatus (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetGpuInfoStatus (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetLastWaitedAddress (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetNumTcaUnits (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetProtectionFaultTimeStamp (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetShaderProgramBaseAddress (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmGetShaderStatus (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmInsertThreadTraceMarker (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmMapComputeQueueWithPriority (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmRequestFlipAndSubmitDoneForWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmSetEmbeddedPsShader (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmSetEmbeddedVsShader (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmSetWaveLimitMultipliers (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmSubmitAndFlipCommandBuffersForWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmSubmitCommandBuffersForWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)

@oneandonlydean
oneandonlydean merged commit 15f20bb into boykopovar:main Nov 13, 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