vr: stub Hmd2/VrTracker2, opt-in PSVR2 video out #607
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!607
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/607/head"
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?
@psnwd on GitHub · 2026-09-13 18:37 UTC · original
psnwd:psvr2-support→main· +336 −8 · 9 files · 3 commits · closed without mergingRegister Hmd2_v1 and VrTracker2_v1. Unresolved imports answer every call with 0, which a title reads as success; Red Matter (PPSA16509) then sized its reprojection buffers at 0 bytes and aborted. Names come from the imported NIDs.
Three entry points need real answers, the rest only need to not fail: both reprojection size queries return size in rax and alignment in rdx rather than through out parameters, sceHmd2GetDeviceInformation has to report a zero status word with the mount byte set or the session never leaves state 1, and sceVrTracker2QueryMemory sizes its work buffer.
Video out learns bus type 32 and the 0x20000 VR mode bit. The port always opens, since a title refused the handle flips with the error code anyway, so --vr gates the output mode instead: refused, a title gives up on VR and carries on flat, which is the default. VR flips complete as blank - their buffers are GPU image descriptors and there is no panel to reach - so the frame loop runs without a headset.
The uconfig registers the VR render path writes every draw are accepted and dropped; unknown registers elsewhere still abort.
Summary by CodeRabbit
--vrlaunch option.@coderabbitai[bot] on GitHub · 2026-09-13 18:38 UTC · original · edited 2026-09-13 19:03 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
4dd93f59-24c6-4af5-9003-c5aa1d929ad7📥 Commits
Reviewing files that changed from the base of the PR and between
cacfc52946and42c4d4b08d.📒 Files selected for processing (3)
src/graphics/host_gpu/hostMemory.cppsrc/graphics/host_gpu/hostMemory.hsrc/libs/libHmd2.cpp🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
The change adds disabled-by-default VR configuration, the
--vroption, VR output validation, writable host-memory checks, handlers for unknown GPU registers, andlibSceHmd2andlibSceVrTracker2guest-library functions.Changes
PlayStation VR2 support
src/common/emulatorConfig.*,src/main.cppvr_enabledflag, theConfig::VrEnabled()accessor, and the--vrcommand-line option.src/graphics/presentation/videoOut.cpp,src/graphics/guest_gpu/command_processor/pm4Handlers.cppsrc/graphics/host_gpu/hostMemory.*src/libs/libHmd2.cpp,src/libs/libs.cpplibSceHmd2andlibSceVrTracker2imports with logging stubs and fixed device, reprojection, and tracker memory responses.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
Suggested reviewers:
nmzikMerge Risk: ⚪ Minimal · up to
42c4dNo supported merge-blocking risk remains in the reviewed change.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-13 18:44 UTC · original · edited 2026-09-13 18:54 UTC
On
src/graphics/presentation/videoOut.cppline 1715 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Validate the base mode before accepting a VR mode.
VIDEO_OUT_OUTPUT_MODE_VRis documented as an addition to an ordinary mode.ValidateOutputConfigcurrently returns before checking the base mode. Therefore,VideoOutConfigureOutputcan store VR alone or VR combined with unsupported bits.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit
cacfc52@coderabbitai[bot] on GitHub · 2026-09-13 18:44 UTC · original · edited 2026-09-13 18:57 UTC
On
src/libs/libHmd2.cppline 94 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 3062
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7870
Validate writable output ranges before writing.
Graphics::HostMemoryRangeIsReadableaccepts read-only mappings. On Windows,HostMemoryAccess::ReadincludesPAGE_READONLY. On Linux, it accepts mappings whose permissions start withr. Both checks can therefore allow the subsequentstd::memsetor field stores to fault the emulator. Use a writable-range check for bothinfoandoutbefore writing.📍 Affects 1 file
src/libs/libHmd2.cpp#L94-L94(this comment)src/libs/libHmd2.cpp#L214-L214🤖 Prompt for AI Agents
✅ Addressed in commit
42c4d4b@coderabbitai[bot] on GitHub · 2026-09-13 18:44 UTC · original · reviewed
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
64a7e9d0-044e-4c98-b8b2-1dd51b03db4a📥 Commits
Reviewing files that changed from the base of the PR and between
d3d7bd33f8and7bfd724746.📒 Files selected for processing (7)
src/common/emulatorConfig.cppsrc/common/emulatorConfig.hsrc/graphics/guest_gpu/command_processor/pm4Handlers.cppsrc/graphics/presentation/videoOut.cppsrc/libs/libHmd2.cppsrc/libs/libs.cppsrc/main.cppIncluded review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@psnwd on GitHub · 2026-09-13 18:59 UTC · original
Status: Main Menu (Can't play I don't have VR 🥇 )
@annahana on GitHub · 2026-09-14 05:45 UTC · original
Will test this with PSVR2 headset directly. Hopefully officiall Sony drivers work.
@Nmzik on GitHub · 2026-09-14 06:32 UTC · original
@psnwd Some of the changes have been merged (Credited to you). ABIs implemented. FSR registers are no longer ignored (IMPORTANT!). VideoOut is still under investigation. I’ll update the PR once everything looks good
@annahana on GitHub · 2026-09-15 19:10 UTC · original · edited 2026-09-15 19:35 UTC
seems from testing good. but Tennis on Court flickers like cracy
https://github.com/user-attachments/assets/e6898bc2-72c2-44d0-b759-ca855a1d03e6
Red Matters seems to boot and waits for imput

Horizon COTM does crash on Source build
42c4d4b--- Error ---
unknown cx reg at 00508: 0x210
in C:\Users\Admin\source\repos\KytyPS5-psnwdKytyPS5\src\graphics\guest_gpu\command_processor\pm4Handlers.cpp:2020
but it is the same on main.
Logs.zip
@psnwd on GitHub · 2026-09-15 19:31 UTC · original · edited 2026-09-15 19:32 UTC
Interesting, I'll check this. Nmzik is also implementing this in main, so I'll clean this up first and test it. Also, did you check it with a PSVR2 headset?
@annahana on GitHub · 2026-09-15 20:04 UTC · original · edited 2026-09-15 20:11 UTC
seems like no OpenXR start is initialized. or i miss a way to say Kyty has control over OpenXR
@Nmzik on GitHub · 2026-09-16 03:22 UTC · original
We are not initializing anything through OpenXR yet, there is no proper VR headset support at the moment. We are only emulating the required ABIs for VR games
@psnwd on GitHub · 2026-09-16 05:01 UTC · original
yes, I'll check it
@annahana on GitHub · 2026-09-17 16:19 UTC · original
Vertigo 2 has the same flicker
https://github.com/user-attachments/assets/d7138aca-c005-41d7-8c35-22ddcc02a657
and Crashes randomly with 843 or starts to the main menu but with a black screen.
--- Guest fault context ---
thread: Loading.PreloadManager
rax=0000000000000000 rbx=00000000000000b3 rcx=0000000000000000 rdx=000000027e671580
rsi=000000027e719ea0 rdi=0000000000000000 rbp=fffffffffffffdff rsp=00000007ebc6b0c8
r8 =0000000000000200 r9 =0000000000000001 r10=0000000901bf1450 r11=0000000901bf1c50
r12=0000000000000400 r13=000000027e71a6a0 r14=0000000901bf1c50 r15=0000000000000001
code (pc-48 .. pc+48, fault at byte 48):
48 8d a4 24 80 00 00 00 e9 90 ad 85 ff 48 8d 64
24 80 48 8b 45 30 48 8d a4 24 80 00 00 00 4c 8d
14 8d 00 00 00 00 e9 8d ad 85 ff 48 8d 64 24 80
48 63 40 04 48 8d a4 24 80 00 00 00 49 39 c7 e9
d3 ad 85 ff 48 8d 64 24 80 48 8b 10 48 8d a4 24
80 00 00 00 48 8d 64 24 80 4c 8b 60 08 48 8d a4
stack:
0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
00000007ebc6b1e8 0000000000001540 0000000000000ac0 000000027e671118
00000000000000f2 00000007ebc6ca50 00000009018604ba 000001800000017e
000000020000017a 000000027e717420 00000007ebc6ca84 0000001000000010
0000001000000010 0000001000000010 0000001000000010 0000004000000040
--- Build ---
Source build
42c4d4b--- Error ---
Unhandled host exception: type=1 code=3221225477 pc=0x000000090205ec21 access=1 address=0x0000000000000004
in C:\Users\Admin\source\repos\KytyPS5-psnwdKytyPS5\src\loader\runtimeLinker.cpp:843
@annahana on GitHub · 2026-09-18 17:30 UTC · original
PIstol Whipe shows here a animation but realy broken. Main does not show anything
https://github.com/user-attachments/assets/4f6c4862-217e-4af2-9bca-833ebd17193c
Log of the game.
_kyty.zip
and the Log from Main.
_kyty.txt
and what main shows

@Nmzik on GitHub · 2026-10-21 19:41 UTC · original
Superseded by #1726 and
113327266.Pull request closed