2626 Commits
Author SHA1 Message Date
Jeremy Bowers 70d096f8d7 Fix issue with intermittent slowdown.
An error in the way frames were submitted to XR resulted in intermittent
slowdown that fooled me for a while as being shader compilation stutter,
and had me down the wrong track of investigating that.

However this was actually the root cause. This should bring Baiji up to
performance parity with the current Dolphin release, as near as I can tell.

Resolves Issue #13.
2026-10-16 01:00:07 -04:00
Jeremy Bowers 24634ba1bd Fix the flat backend's way of requesting a surface to draw on. 2026-10-11 12:20:31 -04:00
Jeremy Bowers 6c95b40453 Steam Frame: complete stereo eye writes before XR release
StereoScreen previously submitted and released each Vulkan eye separately
while its image writes could still be in flight. On native Steam Frame
this produced conspicuous doubled/stale-image hiccups and apparent
backward jumps, even though API-side frame identities remained ordered.
A capture covering 16,699 XFB copies found no gameplay source regression,
GPU-submit reversal, XR display-time reversal, or eye-ID mismatch.
SteamVR motion smoothing was already forced off.

For Baiji StereoScreen, defer eye releases until both blits are recorded,
submit their GPU work together, wait once for completion, release both
images under the graphics-queue lock, then publish the quad layers.
Keep this wait even with timeline semaphores enabled: submitted writes
alone were insufficient for correct image delivery on Frame. The wait
trades some CPU/GPU overlap for a completed stereo pair.

Also exclude xrEndFrame from the video blit/completion/release/publish
transaction with a handoff mutex. The previous atomic flag had a
check-to-submit race. Take the handoff lock before publish/queue locks,
and never hold the graphics-queue lock during the completion wait.
PresentBackbuffer already advances frame resources; the stereo submit
must not advance them again.

CPU-side handoff locking alone did not cure the artifact. Headset tests
with the completed-pair handoff in Super Mario Galaxy 2 at 2x/120 Hz
confirmed that remaining misses look like ordinary dropped frames,
rather than doubled images or huge hiccups. The clean Frame SDK build
and launcher CLI smoke check passed. Remove the temporary timing/order
capture code and retain the findings and lock-order guidance in AGENTS.md.
2026-10-04 23:10:20 -04:00
Jeremy Bowers 22f6884ca0 Checkpoint. This has a number of things including defaulting eager_heartbeat to true. 2026-10-04 14:41:52 -04:00
Jeremy Bowers 834cdddd2e OpenXR: add Steam Frame controller input 2026-10-03 22:21:35 -04:00
Jeremy Bowers bec9d1beae OpenXR: keep controller input in Flat Vulkan mode 2026-10-03 21:00:54 -04:00
Jeremy Bowers 3ec01541fd OpenXR: add configurable presentation modes 2026-10-03 20:06:38 -04:00
Jeremy Bowers 64878c16c4 Polish stereoscopic virtual screen mode
- Make Flat Screen and Stereo Screen checkboxes mutually exclusive in VRPane.
- Fix Vulkan Android stereo-screen submission to end the render pass and
  submit the command buffer once before releasing both eye images, instead of
  once per eye.
2026-10-03 01:36:00 -04:00
Jeremy Bowers fb2e70a608 OpenXR: implement stereoscopic virtual screen mode
- Add IOpenXRSwapchain::GetEyeSwapchainHandle() and SubmitStereoFlatFrame(),
  with per-backend overrides for Vulkan, D3D11, D3D12, and OGL.
- Add OpenXRManager::SubmitStereoQuadFrame() which builds two world-locked
  XrCompositionLayerQuad layers with XR_EYE_VISIBILITY_LEFT/RIGHT and publishes
  them through the pacing thread (or EndFrame on the legacy path).
- Extend PublishedXRFrame and FrameThreadLoop to submit the stereo quad pair.
- Add UI checkbox for Stereo Screen in VRPane and VRConfigWidget.

The game renders with classic SBS stereoscopy; left/right XFB layers are blit
into the corresponding OpenXR eye swapchains and shown as a 3D floating screen.
2026-10-03 01:29:02 -04:00
Jeremy Bowers aa2871d9e6 VK/OpenXR: support headless Vulkan VR session
- Skip Vulkan surface creation when VR session is active; output goes to
  OpenXR swapchains, not a desktop window. This avoids WSI crashes under
  compositors such as Gamescope.
- Guard VKGfx backbuffer/present/fullscreen paths against a null swapchain
  in headless mode.
- Allow Present() and Presenter::Initialize() to run on any VR-active
  backend, not only Android GLES, so the XR frame lifecycle works with
  headless Vulkan.

Cleaned up diagnostic init logging added during earlier debugging.
2026-10-03 01:22:39 -04:00
iChris4 c28b2ba0f8 Added spinbox in Graphics settings to set custom command list buffer 2026-07-27 04:19:10 +02:00
iChris4 06fc90a0bf Increased command list from 3 to 16 2026-07-26 02:45:29 +02:00
iChris4andClaude Opus 5 05d91da8bf Fixed Vulkan VR crash when opening a second game in one process
Opening a game, closing it, and opening another crashed or device-lost on
the Vulkan backend with VR enabled. D3D11 and D3D12 both restart cleanly,
so this was Vulkan-specific rather than an OpenXR runtime limitation.

Root cause, proven with VK_EXT_device_fault plus
VK_EXT_device_address_binding_report: the fault is a write-invalid at a
page-aligned address that the binding tracer reports as not owned by the
second game device. The OpenXR compositor still references resources that
lived on the first game VkDevice; destroying that device frees the memory
and the compositor later writes into the freed page. The D3D backends are
immune because their shared compositor resources are COM ref-counted,
while vkDestroyDevice frees unconditionally.

Fix: persist and reuse the VulkanContext (VkInstance and VkDevice) across
VR games, so vkCreateDevice/vkDestroyDevice run once per process and those
pages are never unmapped. Per-game objects are still fully recreated,
including the surface, swapchain, object cache, command buffers, and the
OpenXR session and XrInstance. A device-lost context is never persisted. A
non-VR launch, or a runtime requiring a device extension the persisted
device lacks, discards it and initializes fresh.

Two problems that persisting exposed:

- InitBackendInfo() creates and destroys a temporary VkInstance on every
  game boot and then calls UnloadVulkanLibrary(), which nulls every global
  Vulkan function pointer. Reuse now re-resolves the instance and device
  dispatch for the persisted handles.

- That same UnloadVulkanLibrary() unmaps vulkan-1.dll on runtimes that do
  not otherwise pin it, invalidating the persisted handles. This is why
  VDXR still failed after SteamVR worked. Added KeepVulkanLibraryLoaded()
  so unloading is suppressed while a device is persisted.

Also removes the XR_KHR_vulkan_enable2 path. Creating a second device
against a retained XrInstance crashes inside the runtime in a way SEH
cannot catch. The backend now always uses legacy XR_KHR_vulkan_enable,
where Dolphin owns instance and device creation and the runtime binds at
xrCreateSession.

Supporting changes: ordered OpenXR session teardown (ShutdownSession and
DestroySession), a device-lost guard in CommandBufferManager that stops
emulation instead of resubmitting to a dead device, synchronous release of
Dolphin views and framebuffers before xrDestroySwapchain, and the two GPU
fault diagnostics. Note that vkGetDeviceFaultInfoEXT must be called with
vendorBinarySize zeroed on the second call, or the driver writes the
vendor blob to a null pointer.

Verified on SteamVR/PSVR2, VDXR/Quest 3, and Meta Link over repeated
open/close cycles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 15:43:14 +02:00
iChris4 6ff81b072f Added Screen Pane Depth options type "Original, Physical, Flat" 2026-07-23 23:40:13 +02:00
iChris4 d94a5a0cfe Updated "Configure in VR" Wii Remote OpenXR controller bindings 2026-07-20 02:53:55 +02:00
iChris4 e77555d766 XFB pose stamps & EFB clear moved off the present path 2026-07-18 23:24:17 +02:00
iChris4 63a8bf0714 Vulkan Multiview Fixes for Ubershaders and EFB clears 2026-07-18 00:02:36 +02:00
iChris4 a77f7c85d3 D3D12 Texture2DArray OpenXR swapchain 2026-07-17 04:33:48 +02:00
iChris4 cad9760185 Updated "Pink" Hunting Mode 2026-07-16 22:37:18 +02:00
iChris4 dbafa8bdf4 XR CPU Thread affinity 2026-07-16 17:32:10 +02:00
iChris4 a4a4eec869 Defer eye blit to submit time 2026-07-16 15:38:48 +02:00
iChris4 3bfa9ad3ec Improved passthrough & Added XRPacingThread 2026-07-12 01:32:52 +02:00
iChris4 490695d83f Added foveated rendering 2026-07-11 04:16:02 +02:00
iChris4 19d89d4ba0 Merge branch 'openxr-work' of https://github.com/iChris4/dolphinXR into openxr-work 2026-07-10 16:04:21 +02:00
iChris4 493b440411 Added D3D12 OpenXR Support 2026-07-10 16:01:42 +02:00
iChris4 7ad9950f70 ClearEFB passthrough optimization 2026-07-10 00:28:08 +02:00
iChris4 1db9a150c7 Added Quest Passthrough 2026-07-10 00:03:19 +02:00
iChris4 d9565464a9 Added 2D "cinema" mode 2026-07-07 05:37:17 +02:00
iChris4 bc7a7dbe67 Updated Passthrough Mode 2026-07-07 04:11:24 +02:00
iChris4 f7abfcd745 Initial OpenGL VR Support 2026-07-04 02:43:15 +02:00
iChris4 06592e5f52 Improve Vulkan OpenXR performance and compatibility 2026-06-13 22:26:39 +02:00
iChris4 04113519b6 Opcode Replay Added 72,90,120hz 2026-05-15 02:15:13 +02:00
iChris4andClaude Sonnet 4.6 6442017d78 Add VR Forced VBI Frequency setting (Auto/72/90/120 Hz)
Replaces the boolean "Force VBI to 90 Hz" override with an explicit
choice across Off / Auto / 72 / 90 / 120 Hz. Auto samples the headset
refresh rate at OpenXR session startup (via XR_FB_display_refresh_rate)
and rounds to the closest supported value. Migrates the legacy
AutoVBIFromHMD setting on first load. Per-game profile editor and the
HK_VR_TOGGLE_FORCE_VBI hotkey are updated to cycle Off <-> Auto.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 17:36:55 +02:00
iChris4andClaude Sonnet 4.6 5878ccbad3 Fix Meta Link Vulkan crash from v1 1.0.0 max-version quirk
Meta's Oculus runtime reports max Vulkan 1.0.0 via XR_KHR_vulkan_enable
v1, which would clamp Dolphin's instance to 1.0 and crash vkCreateDevice
(multiview is a 1.1 feature). Treat 1.0.0 as "unknown" and keep the
negotiated 1.1/1.2 instance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 17:33:43 +02:00
iChris4andClaude Sonnet 4.6 d1511f187b Vulkan OpenXR: async frame finalization on Quest submit thread
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:17:29 +02:00
iChris4 c80961c437 Quest Vulkan Multiview fixes & Performances 2026-05-02 15:58:54 +02:00
iChris4 1b0eb14e15 Vukan Virtual Desktop Fix 2026-04-25 01:45:44 +02:00
iChris4 adaeeaf3d4 Fix for Vulkan 2026-04-24 16:15:01 +02:00
iChris4 2929ead841 Initial Support for Quest 2026-04-24 13:40:27 +02:00
iChris4 19ba9b05fa Opcode Replay Fix & Lock Head Pose Per Frame Fix 2026-04-23 16:43:59 +02:00
iChris4 8ecef6ef1e "FOCUSED" session state & Oculus/Meta profiles 2026-04-14 03:14:14 +02:00
iChris4 49febf2cbe WII Controller Config Screen Overlay for OpenXR & Quest 3 Controller Fix 2026-04-12 02:08:02 +02:00
iChris4 677aa34050 Added ARMode by Clodo76 2026-04-11 18:08:04 +02:00
iChris4 a2dad38be5 Add OpenXR support and related VR changes 2026-04-07 00:18:01 +02:00
oltolm 60351c19cc Misc: fix compiler warning: implicit declaration of function 2026-02-08 00:37:29 +01:00
OatmealDome 168dbb0ab8 Merge pull request #14302 from oltolm/opengl_assert
DX, OGL: fix assert
2026-01-25 21:06:57 -05:00
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00
oltolm 169f99c14d DX, OGL: fix assert 2026-01-24 20:38:05 +01:00
JMC47 035bcffc63 Merge pull request #14289 from Sintendo/typos
Fix various typos and spelling mistakes
2026-01-17 19:10:50 -05:00
Sintendo 1e0473e44f Fix various typos and spelling mistakes 2026-01-17 20:11:38 +01:00