feat(libSceVrTracker): implement memory queries, init and term, device registration and recalibration checks #9224
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9224"
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 YossiYad on 2026-10-21T15:36:06Z.
What
10 libSceVrTracker exports threw. They now follow shadPS4's vr_tracker.cpp, whose parameter shapes the declarations already used:
sceVrTrackerQueryMemorychecks the size, profile (0 or 100) and calibration modes (no automatic HMD calibration). It reports onion 0x400000, or 0x800000 with automatic Move calibration, garlic 0x3000000 and work 0x1000000, all 0x10000-aligned.sceVrTrackerInitandsceVrTrackerTermhold the initialized state:ALREADY_INITIALIZEDcomes before any argument check.NOT_INIT.sceVrTrackerRegisterDevice,...2and...Internalkeep one handle per device type (HMD, DualShock 4, Move, gun) and returnDEVICE_ALREADY_REGISTEREDfor a second one. A type above 3 or anInternalmode above 4 isARGUMENT_INVALID.sceVrTrackerUnregisterDevicefrees the matching handle. A negative or unknown handle isARGUMENT_INVALID.sceVrTrackerRecalibrateandsceVrTrackerSetDurationUntilStatusNotTrackingcheck their arguments. Recalibration returnsDEVICE_NOT_REGISTEREDfor the HMD (shadPS4's behaviour with no headset) or for a type with no handle.sceVrTrackerGpuWaitAndCpuProcessreturnsNOT_EXECUTE_GPU_SUBMIT, since without a camera no GPU submission happens.Unlike shadPS4:
As in shadPS4, Term keeps the registered handles. Not measured on a PS5; the debt entry says so, and the implemented names leave the pending lists.
sceVrTrackerGetTime,sceVrTrackerGpuSubmitandsceVrTrackerGpuWaitare left to #8650, which answers them before initialization. Once Init can succeed here, those need an initialized path too. The test goes in its ownGuestVrTrackerDevices.cppbecause #8650 addsGuestVrTracker.cpp.sceVrTrackerInittakes theVrTrackerInitParamdeclaration from #9137.Tested
Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), based onmaincecb540a63:guest_vr_tracker_devices(core/libs/tests/GuestVrTrackerDevices.cpp) checks:main. Each of 16 mutations makes it fail:ALREADY_INITIALIZEDctest: 1794 of 1802 pass. The 8 failures fail the same way onmainon this machine and do not link libSceVrTracker:application_heap_scripting,application_heap_lazy,agc_driver_guest_memory_lifetime,agc_driver_image_array_window_past_layer_limit,agc_driver_tessellationand the threenet_dontwait_blocking_*cases.tools/progress.py --compare: libraries +0.09%, 10 functions implemented, none lost.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyfindscore/libs/CMakeLists.txtshared with other PRs.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 github-actions[bot] on 2026-10-21T15:36:58Z.
Progress report (
3ca07d0→24447ef)📈 System libraries: 43.31% (+0.08%, +9 implemented functions)
✅ 9 implemented
sceVrTrackerGpuWaitAndCpuProcesssceVrTrackerQueryMemorysceVrTrackerRecalibratesceVrTrackerRegisterDevicesceVrTrackerRegisterDevice2sceVrTrackerRegisterDeviceInternalsceVrTrackerSetDurationUntilStatusNotTrackingsceVrTrackerTermsceVrTrackerUnregisterDeviceImported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T05:33:53Z.
Rebased onto
mainda54c652eafter #9137 (head8f0a0d2ef). #9137 gavesceVrTrackerInitaVrTrackerInitParamfrom the module: a 144-byte layout, with the 128-byte one still unresolved. This PR reads shadPS4's 128-byte layout, so a 144-byte parameter now throws, as onmain, instead of failing these checks withARGUMENT_INVALID. The test checks that throw, and the debt entry and description say so.guest_vr_tracker_devicespasses 3 of 3.Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T12:58:48Z.
Rebased onto
main8b3a6ba88(head24447ef99). The only conflict was #9201's test registration next to this one incore/libs/CMakeLists.txt, and I kept both.guest_vr_tracker_devicespasses 3 of 3.