Run the same-device Vulkan OpenXR backend on desktop Linux

Lepton's Vulkan driver has no external memory or sync fd extensions,
so the Steam Frame gets a native SteamOS build instead. Its backend is
the PC's: OpenXR creates Dawn's own Vulkan instance and device, and the
eyes are copied into the swapchain on Dawn's queue, with nothing shared
between devices.

- openxr_vulkan_win32 and Aurora's vulkan_win32_interop now compile on
  desktop Linux. Dawn links statically there, so the bridge calls the
  patched package's hooks directly, and exists only when the package's
  aurora-dawn.json declares the Vulkan hook ABI (AuroraDawnProvider
  turns AuroraVulkanAbi into AURORA_DAWN_VULKAN_HOOKS); a stock Dawn
  keeps the stubs and VR falls back to the desktop.
- openxr_integration.cpp gains a Linux branch: XR_KHR_vulkan_enable2,
  the timespec clock, refresh rate, performance level, the Frame
  controllers and eye gaze; fragment density maps are requested on
  Linux as on the Quest (fdm.cpp and gpu.cpp, AURORA_FDM=0/1 overrides).
- Controller motion uses XR_KHR_convert_timespec_time on any Linux.
- CMake: Vulkan headers are fetched for Linux OpenXR builds, the
  headset option is MKW_HEADSET on Android and Linux, and Linux aarch64
  builds take MKW_LINUX_CPU (cortex-x4 for the Steam Frame, else native).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HBRGKTE1GnN2ah8gcZKr3
This commit is contained in:
Claude committed 2026-10-04 09:48:48 +00:00
1 parent da0d13bdd2
commit 28a25108c6
13 files changed
+137 -36

No files matched your search

@@ -268,7 +268,10 @@ elseif (_aurora_dawn_provider STREQUAL "package")
# A package built with Aurora's patches (android/Build-QuestDawn.ps1) describes them in
# aurora-dawn.json. Only such a package has the fragment density map ABI
# (include/aurora/dawn_fdm_abi.h); aurora_core compiles its callers against it.
# The Vulkan hook ABI (include/aurora/dawn_vulkan_abi.h) is the other half: a package built by
# Launcher/build-dawn-linux.sh carries it, and the Linux OpenXR backend needs it.
set(AURORA_DAWN_FDM_ABI 0 PARENT_SCOPE)
set(AURORA_DAWN_VULKAN_HOOKS_ABI 0 PARENT_SCOPE)
if (EXISTS "${_dawn_pkg_dir}/aurora-dawn.json")
file(READ "${_dawn_pkg_dir}/aurora-dawn.json" _aurora_dawn_manifest)
string(JSON _aurora_dawn_fdm_abi ERROR_VARIABLE _aurora_dawn_manifest_error
@@ -277,6 +280,12 @@ elseif (_aurora_dawn_provider STREQUAL "package")
set(AURORA_DAWN_FDM_ABI ${_aurora_dawn_fdm_abi} PARENT_SCOPE)
message(STATUS "aurora: Dawn package carries the fragment density map ABI ${_aurora_dawn_fdm_abi}")
endif ()
string(JSON _aurora_dawn_vulkan_abi ERROR_VARIABLE _aurora_dawn_manifest_error
GET "${_aurora_dawn_manifest}" AuroraVulkanAbi)
if (NOT _aurora_dawn_manifest_error AND _aurora_dawn_vulkan_abi GREATER 0)
set(AURORA_DAWN_VULKAN_HOOKS_ABI ${_aurora_dawn_vulkan_abi} PARENT_SCOPE)
message(STATUS "aurora: Dawn package carries the Vulkan hook ABI ${_aurora_dawn_vulkan_abi}")
endif ()
endif ()
_aurora_dawn_set_platform_backends()
+8
View File
@@ -39,6 +39,14 @@ if (AURORA_ENABLE_GX)
# of producing unresolved interop references.
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
target_sources(aurora_core PRIVATE lib/webgpu/d3d12_interop.cpp lib/webgpu/vulkan_win32_interop.cpp)
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
# The same-device Vulkan bridge, for the desktop Linux OpenXR backend (SteamOS on the Steam
# Frame). Static Dawn on Linux is linked directly, so the bridge is compiled in only against
# a package with Aurora's Vulkan hooks; otherwise the file is its C ABI stubs.
target_sources(aurora_core PRIVATE lib/webgpu/vulkan_win32_interop.cpp)
if (AURORA_DAWN_VULKAN_HOOKS_ABI)
target_compile_definitions(aurora_core PRIVATE AURORA_DAWN_VULKAN_HOOKS=${AURORA_DAWN_VULKAN_HOOKS_ABI})
endif ()
endif ()
# Android/Vulkan counterpart: the AHardwareBuffer stereo bridge. The file
# compiles to C ABI stubs on every other platform so the runtime's OpenXR