feat(libSceGnmDriver): export sceGnmDrawInitDefaultHardwareState200 from the regular driver #19990
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19990"
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 Gag21 on 2026-11-14T10:26:47Z.
What
A PS4 title can import
sceGnmDrawInitDefaultHardwareState200(0H2vBYbTLHI) from the regularlibSceGnmDriver.mainexports that function only fromlibSceGnmDriverForNeoMode, so the import stays unresolved and the title stops at load (FAIL: unresolved ELF import 0H2vBYbTLHI). This adds the export to the regular driver.sceGnmDrawInitDefaultHardwareState200_nid_disambig1keeps the guest NID with a distinct host symbol, as the other regular-driver exports that also exist in the Neo provider do.sceGnmDrawInitDefaultHardwareState175does.a808e762, the reference the GNM libraries already cite: itsInitSequence200for a base title, and itsInitSequence200Neo(the arraylibSceGnmDriverForNeoModealready writes) whensceKernelIsNeoModeanswers 1. The base sequence is derived at compile time from the Neo array by leaving out the three packets that only the Neo sequence has; the test compares it with the full base sequence written out word by word.libSceGnmDrivernow linkslibkernel_sysforsceKernelIsNeoMode. The mode is read before anything is written, so where that function throws (a title withparam.json, or no metadata) the buffer is untouched.docs/dev/debt/libSceGnmDriver.mdrecords what is not measured: neither sequence is compared with console output, whether the console's regular module chooses by Neo mode, and the answer for a null buffer.This is one of five imports of that kind in the title below. The other four (
sceGnmUpdatePsShader,sceGnmUpdateVsShader,sceGnmUpdateHsShader,sceGnmUpdateGsShader) are in #17711 and are not touched here. #18206 (unversionedsceGnmDrawInitDefaultHardwareState) and #18217 (...State350,...ContextState400) add neighbouring exports and do not add this one.tools/pr_overlap.py --branchreports no shared exports and two textual conflicts: #18217 (Export.cppincludes and the lines aftersceGnmDrawInitDefaultHardwareState175,Api.hpp) and #17942 (Export.cppincludes). Whichever merges second needs a routine rebase; this PR does not build on either.Tested
Windows 11 Pro 10.0.26300, i5-6600K, WinLibs GCC 16.2.0, CMake 4.4.4, Ninja, Release,
BUILD_TESTING=ON, onmain2cebbe43ee.New test
gnm_default_state_200(tests/DefaultState200.cpp) runs itself in a child process per case, each with its ownparam.sfo: a base title (ATTRIBUTE0, andATTRIBUTEwith other bits set), a Neo title (ATTRIBUTEbit 23), and no metadata. It checks the full 256 dwords against the expected sequence for the mode, the single trailing NOP, whole PM4 packets, that a 255-dword buffer returns 0 unwritten, that nothing is written before or after the 256 dwords, and that without metadata the call throws with the buffer untouched.Does it fail without the change? With the mode choice reversed in
Export.cpp, thebase,otherandneocases each fail withthe register sequence differs. Without the export the test does not link.gnm_default_state_200,guest_gnm_driver,gnm_driver_packets,gnm_driver_submit_wait,gnm_shader_writersand the sixguest_gnm_neo*tests: 11 of 11 pass.public_headerspasses.A title: a PS4 game dump (CUSA01709 01.02), converted with
relinker --windowsand started for up to 40 s. The eboot needs #19959 to unwrap and a local relinker change equivalent to #17105 to convert; itsDT_NEEDEDnameslibSceGnmDriver_padebug, so a copy oflibSceGnmDriver.prxunder that name stood in for #18087. None of that is in this PR.mainb6717527ce(libSceGnmDriverunchanged up to2cebbe43ee)0H2vBYbTLHIand the four in #17711The title still stops at load, so the function was not called by it.
python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --names sceGnmDrawInitDefaultHardwareState200reportsmain: core/libs/prx/libSceGnmDriverForNeoMode (implemented)andopen: none;--branchran over 1,595 open pull requests with the result above.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T13:16:52Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
b3cb05bdcf4158bcf639a45edf7d34f1999706f7adds the regular-driver export and mode-specific state sequence; the inspected implementation and tests support the stated behavior, while no checks were run during this review.What I ran
No commands or tests were run. I read the prepared diff and changed files, then inspected the relevant kernel mode query, Neo sequence, and driver export context through
repo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Builds, tests, and title runs were not independently verified. The prepared files bundle was empty; all five changed files were read from the pinned repository head with
repo_read.py. No exclusions were listed in the manifest.To get this to a good state
Nothing is required.