fix(libSceHmd2): check the mirroring option before the reprojection pipeline #25756
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25756"
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 edubox on 2026-11-22T16:43:47Z.
What
sceHmd2ReprojectionSetMirroringOptionthrew on every option once a reprojection session existed, including the ones the firmware rejects before it ever reaches the pipeline.mainalready answers0x8A72000B(REPROJECTION_NOT_INITIALIZED) without a session; this adds the option check the 13.40 wrapper performs next:0x8A720008(PARAMETER_NULL);modeother than 0 or 1, or any of the sevenreservedwords nonzero, answers0x8A720009(PARAMETER_INVALID);Evidence is the 13.40
libSceHmd2.sprx: the wrapper comparesmodeand each reserved word against zero and returns those codes before handing the call on. Not measured on a console beyond the module body.Hmd2::MirroringOptionis the 32-byte layoutinclude/Api.hppalready pins (mode at 0, seven reserved words). The read goes throughGuestCopyIn_nid_no_patchwitherrnopreserved, as the other argument-taking exports in this file do.Tested
Linux x86-64 (CachyOS), GCC 16.2.1, Release,
BUILD_TESTING=ON, onmaine3f556c718:guest_hmd2,guest_hmd2_gazeandguest_hmd2_gaze_args: 3/3 pass.Export.cppatmainand the new assertions kept,guest_hmd2aborts withsceHmd2ReprojectionSetMirroringOption not implemented; restoring the change makes it pass. The new cases cover a null pointer, an unmapped pointer,mode = 2, each of the seven reserved words set on its own, and both valid modes still throwing inside a session.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkare clean.tools/pr_overlap.py --branch fix/hmd2-mirroring-option-checks: no shared exports; it lists one open pull request that also changesExport.cppand cannot be compared because it conflicts withmain(it copies other Hmd2 structures through the guest helpers, not this export).Not run: Windows, a console, and a title that opens a reprojection session.
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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T16:52:01Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
58d31dce47:tools/check_conventions.pypassed.guest_hmd2_testsbuilt cleanly.guest_hmd2):core/libs/prx/libSceHmd2/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T17:03:56Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation matches the stated validation order and preserves the existing unimplemented path for valid options.
What I ran
Reviewed head
58d31dce47104dac44387911aa9430f71bab78bcagainst basemain. No commands or tests were run;repo_read.pywas unavailable as a runnable command in this interface. Read the prepared description, commits, manifest, diff, and all changed lines incore/libs/prx/libSceHmd2/Export.cpp,core/libs/tests/GuestHmd2.cpp, anddocs/dev/debt/changes/fix-hmd2-mirroring-option-checks.md. Also read the option layout and the adjacent copy-in path.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports three passing tests, a passing negative control, and clean convention and debt checks; these were not run independently. Windows, console behavior, and the titled reprojection-session scenario were not verified. No changed file was excluded; all three changed files marked included in the manifest were read in full or across their changed lines. The full text of
Export.cppandGuestHmd2.cppbeyond the targeted ranges was not read.To get this to a good state
Nothing is required.
Pull request closed