Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU: OpenXR integration #11601

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open

GPU: OpenXR integration #11601

wants to merge 39 commits into from

Conversation

Beyley
Copy link

@Beyley Beyley commented Dec 7, 2024

Description

Implements functions to create/manage an OpenXR instance/system/session/swapchain, without exposing raw GPU handles to the end user. This branch still needs a lot of work, but the foundation is layed at the least, and I'm opening this PR to hopefully make it easier to get some help with some of the problems I'm currently encountering (namely the validation error and the resource management oopsies I'm likely committing).

Example usage.

Existing Issue(s)

#10925

TODO

  • VSCode seems to have decided to reformat bits of SDL_gpu.h, so I'll need to fix that (is there a clang-format config I should be using? or is the formatting all manual)
  • Code styling is all over the place (C is not my main language, so my code style is a bit of a mess)
  • Vulkan validation error on app exit, not sure how to resolve
    • VUID-vkDestroyImageView-imageView-01026(ERROR / SPEC): msgNum: 1672225264 - Validation Error: [ VUID-vkDestroyImageView-imageView-01026 ] | MessageID = 0x63ac21f0 | vkDestroyImageView(): can't be called on VkImageView 0x9f9b41000000003c[] that is currently in use by VkFramebuffer 0x45d6d1000000004c[]. The Vulkan spec states: All submitted commands that refer to imageView must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)
  • Vulkan resource management needs a look from an experienced vulkan dev (I'm not too familiar with writing Vulkan code, but I tried my best to follow the OpenXR specifications for how to manage the Vulkan resource states)
  • My CMake patches are a mess and I likely need to rewrite them, right now they just assume OpenXR is available, so for now i've set OpenXR to disabled by default, you can enable it with -DSDL_GPU_OPENXR=ON when configuring the project
  • I need to check which OpenXR graphics binding extensions are available before picking the backend and creating the GPU device, right now I assume XR_KHR_vulkan_enable2 is always available (this is true on all PC OpenXR runtimes except the Microsoft WMR OpenXR runtime, which is D3D11 and D3D12 only)
  • De-duplicate most of the device picking logic and such inside SDL_gpu_vulkan.c
  • Lots of erroneous XR_ERROR_RUNTIME_FAILURE error returns (should we even be returning XrResult in the SDL API surface?)
  • Decouple OpenXR from SDL_gpu.h (SDL_gpu_xr.h maybe?)
  • Support non XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY form factors
  • Expose openxr-loader getprocaddress
  • Move GPU stuff from SDL_openxr.h -> SDL_gpu.h
  • Figure out what OpenXR swapchain usage flags are allowed inside SDL_CreateGPUXRSwapchain
  • Figure out OpenXR loading on Android (specifically with the official Khronos OpenXR Loader)
  • Finish D3D12 backend support
  • Allow requesting specific texture format for the swapchain, to allow using depth swapchains

@Beyley
Copy link
Author

Beyley commented Dec 17, 2024

Ported the branch to windows, and its now tested working with latest SteamVR on Windows 10
image of OpenXR app running on windows

so now it is tested working with the dominant OpenXR runtimes on Windows (SteamVR) and Linux (Monado)

also tested working on the Windows Oculus runtime

still a long way to go before being ready to merge though

@Beyley Beyley force-pushed the openxr branch 2 times, most recently from 9366a29 to 0b64757 Compare December 22, 2024 21:08
@Beyley
Copy link
Author

Beyley commented Dec 23, 2024

Aside from the validation errors on exit, this branch is in a fully usable state (I've been building a game with it for the past couple weeks, and that's mostly what has driven this work).

While it's definitely not ready to be merged, I think it's in a state where it's ready to get preliminary review and pointers to where to take the public API surface, since right now its a bit cobbled together.

I also need help with the Vulkan validation error on app exit

VUID-vkDestroyImageView-imageView-01026(ERROR / SPEC): msgNum: 1672225264 - Validation Error: [ VUID-vkDestroyImageView-imageView-01026 ] | MessageID = 0x63ac21f0 | vkDestroyImageView():  can't be called on VkImageView 0x9f9b41000000003c[] that is currently in use by VkFramebuffer 0x45d6d1000000004c[].
The Vulkan spec states: All submitted commands that refer to imageView must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)

Just run this fork of SDL_gpu_examples on the openxr branch, using the latest version of this PR, then close the app as normal.

You are required to have an OpenXR runtime setup, so either build Monado with the simulated driver, use an actual device with SteamVR, or some other simulator like the Meta XR Simulator

@Beyley Beyley marked this pull request as ready for review December 23, 2024 00:48
Copy link
Collaborator

@thatcosmonaut thatcosmonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, it's clear that some serious effort has gone into this already, so thank you for that.

For build system and dynamic loader stuff, I think we should defer to the build system expert @madebr who I'm sure will have comments.

Some general notes on my end:

I think SDL_openxr.h can just be folded into SDL_gpu.h, it depends on gpu.h anyway and all of the API surface relies on GPU API handles.

The Vulkan device setup functions are basically fully duplicated. I think it would be possible to just stick the XR setup inside the rest of the setup functions. I might even go as far as saying that there shouldn't be a separate CreateXRDevice and we could just include XR setup details as device properties.

I think the same probably goes for swapchain creation, but I'll have to look at it more closely.

What's the OpenXR story for D3D12/Metal? In general I've been reluctant to merge features that are only implemented on one backend because I don't want to give the impression that features might be missing or different on specific backends. If you're not able to develop for these platforms that's fine but we should try to find someone who can. Unfortunately I don't have a VR device so I can't be much help there personally.

@thatcosmonaut
Copy link
Collaborator

I also need help with the Vulkan validation error on app exit

VUID-vkDestroyImageView-imageView-01026(ERROR / SPEC): msgNum: 1672225264 - Validation Error: [ VUID-vkDestroyImageView-imageView-01026 ] | MessageID = 0x63ac21f0 | vkDestroyImageView():  can't be called on VkImageView 0x9f9b41000000003c[] that is currently in use by VkFramebuffer 0x45d6d1000000004c[].
The Vulkan spec states: All submitted commands that refer to imageView must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)

This sounds like the device isn't asked to wait for idle before destroying the swapchain. You need to make sure the device is idle before teardown.

@Beyley
Copy link
Author

Beyley commented Dec 23, 2024

I think SDL_openxr.h can just be folded into SDL_gpu.h, it depends on gpu.h anyway and all of the API surface relies on GPU API handles.

I was thinking the same aswell, but when doing so, I needed to define a bunch of extra types to not depend on the upstream OpenXR headers, which is why I originally created the SDL_openxr.h header. I later also was thinking of exposing the internal openxr-loader handle (or at least the getprocaddress function), the same way SDL_vulkan.h does, to aid integration, and those wouldnt fit inside SDL_gpu.h. Perhaps the GPU specific functions should go inside SDL_gpu.h, and the OpenXR types and the getprocaddress function should go inside SDL_openxr.h.

The Vulkan device setup functions are basically fully duplicated. I think it would be possible to just stick the XR setup inside the rest of the setup functions. I might even go as far as saying that there shouldn't be a separate CreateXRDevice and we could just include XR setup details as device properties.

This can be done, perhaps bool SDL.gpu.device.create.openxr, XrInstance* SDL.gpu.device.create.xr.out_instance, XrSystemId* SDL.gpu.device.create.xr.out_system_id. This would allow the two functions to be folded into eachother, and when creating an OpenXR GPU instance, you set create.openxr, and then the two out ptr properties.

I think the same probably goes for swapchain creation, but I'll have to look at it more closely.

Normal GPU swapchain creation is quite different from OpenXR swapchains. OpenXR swapchains are really just an array of VkImage handles gotten from the OpenXR runtime. The functions are unique code except for the end step, which is mostly derivative from the texture creation code, so parts can probably be merged with that.

What's the OpenXR story for D3D12/Metal? In general I've been reluctant to merge features that are only implemented on one backend because I don't want to give the impression that features might be missing or different on specific backends. If you're not able to develop for these platforms that's fine but we should try to find someone who can. Unfortunately I don't have a VR device so I can't be much help there personally.

With regards to D3D12, I don't own a Windows device capable of running an OpenXR runtime. The only device I own is the Volterra ARM64 dev kit, which is missing vital Vulkan extensions to run Monado (the Monado compositor is written in Vulkan, and uses interop extensions for implementing other APIs), and SteamVR does not have an ARM64 Windows port. Someone could very easily contribute D3D12 support though, and I'd be happy to help anyone who wants to try (perhaps the Vulkan side should be cleaned up first though, so there's a good reference of "where to start").

With regards to Metal, I dont believe this should be too strongly of a concern. SteamVR for MacOS was abandoned before OpenXR became a thing, and the WIP MacOS port of Monado does not support the KHR_metal_enable OpenXR extension. Off the top of my head, I don't know any runtime which supports it.

The Khronos extension support report doesn't list a single runtime with the Metal extension, so I don't think we could implement/test this, even if we wanted to.

Turns out the Meta XR Simulator does support it! Seems in the past month this has become feasable. For reference, here's the qtquick3d and godot usages of the extension. I still don't own a capable enough Mac for this, but someone is free to implement it on their own mac using the Meta XR Simulator, and I'd be happy to guide them through it.

@Beyley
Copy link
Author

Beyley commented Dec 23, 2024

This sounds like the device isn't asked to wait for idle before destroying the swapchain. You need to make sure the device is idle before teardown.

Yeah this seems to be the case, I attempted to test this earlier by just sleeping the main thread by 5 seconds and it still happened, but then I realized SDL_WaitForGPUIdle exists, and calling that fixes the validation error. Would it make sense to call VULKAN_Wait internally inside VULKAN_DestroyXRSwapchain? Or should this be deferred to callers

@thatcosmonaut
Copy link
Collaborator

Yeah go ahead and put a Wait in the destroy call. You can see we do something similar for UnclaimWindow and DestroyDevice.

@Beyley
Copy link
Author

Beyley commented Dec 24, 2024

The Vulkan device setup functions are basically fully duplicated. I think it would be possible to just stick the XR setup inside the rest of the setup functions. I might even go as far as saying that there shouldn't be a separate CreateXRDevice and we could just include XR setup details as device properties.

I've made these changes, now, creating an OpenXR capable GPU device looks like this

CMakeLists.txt Outdated Show resolved Hide resolved
include/build_config/SDL_build_config.h.cmake Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated
if(SDL_GPU_OPENXR)
# TODO: actually do this header detection correctly
set(HAVE_OPENXR_H TRUE)
# TODO: im not sure what the optimal way to do this is...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think hardcoding these filenames is fine.
Are the Windows dll and apple dylib unversioned?

Suggested change
# TODO: im not sure what the optimal way to do this is...

Copy link
Author

@Beyley Beyley Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about macOS, but they are not versioned on Windows as built from source/distributed officially.

The OpenXR Loader spec specifies it to be unversioned on Windows, although it does not specify the macOS name (macOS is still fairly so-and-so when it comes to OpenXR).

Copy link

@rpavlik rpavlik Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tend to follow Linux convention on Mac.

(How are the Windows DLLs unversioned? They have version resources, and the loader since like 1.0.9 can be used forward and backward compatible across patch versions, possibly even minor versions if you don't rely on core symbols being exported)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tend to follow Linux convention on Mac.

If they're versioned in the same way on macOS as they are on Linux, I'll change the macOS path to libopenxr_loader.dylib.1

How are the Windows DLLs unversioned? They have version resources, and the loader since like 1.0.9 can be used forward and backward compatible across patch versions, possibly even minor versions if you don't rely on core symbols being exported

Unversioned in that the filenames themselves don't have a version number is what I meant.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@Beyley
Copy link
Author

Beyley commented Dec 24, 2024

I think SDL_openxr.h can just be folded into SDL_gpu.h, it depends on gpu.h anyway and all of the API surface relies on GPU API handles.

I'm struggling with the build system trying to get this working. SDL_gpu.h needs to work even when the OpenXR header isn't imported/available, but SDL_gpu.h cannot define the OpenXR types (which I define myself inside here) due to it being pulled in by SDL_internal.h, and that being a precompiled header incldued before all internal code. Since SDL_internal.h is implicitly and pre-imported by all the internal code (such as SDL_gpu_vulkan.c) relying on openxr.h, I get duplicate definition errors when the internal code tries to import openxr.h.

I'm not entirely sure how to proceed here, I'm not great with C preprocessor spaghetti.

Options I can see are, but there's probably a proper one.
a) Keep the function definitions which rely directly on OpenXR types inside SDL_openxr.h
b) Undefine the conflicting types inside SDL_internal.h (this feels jank/prone to breakage)
c) Don't use the OpenXR types in the function definitions if they aren't available, and instead use generic types like const void * instead of const XrCreateInfo *, or Uint32 instead of XrResult

CMakeLists.txt Outdated
# # endif()
# endif()
# endif()
set(SDL_GPU_OPENXR_DYNAMIC "\"libopenxr_loader.so.1\"")
Copy link
Contributor

@madebr madebr Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like only Linux has a versioned library. This is probably an oversight.

Reminder for me to create a PR to the oxr repo.

@sezero
Copy link
Contributor

sezero commented Dec 24, 2024

Minor thing: I got this bogus warning from gcc:

src/gpu/vulkan/SDL_gpu_vulkan.c: In function 'VULKAN_PrepareDriver':
src/gpu/vulkan/SDL_gpu_vulkan.c:11975: warning: 'instancePfns' may be used uninitialized in this function

Something like the following cures it for me.

--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -11972,7 +11972,7 @@ static bool VULKAN_PrepareDriver(SDL_VideoDevice *_this, SDL_PropertiesID props)
 
 #ifdef HAVE_GPU_OPENXR
     XrResult xrResult;
-    XrInstancePfns *instancePfns;
+    XrInstancePfns *instancePfns = NULL;
     XrInstance xrInstance = XR_NULL_HANDLE;
     XrSystemId xrSystemId = XR_NULL_HANDLE;
     bool xr = SDL_GetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_XR_ENABLE, false);
@@ -12062,7 +12062,7 @@ static bool VULKAN_PrepareDriver(SDL_VideoDevice *_this, SDL_PropertiesID props)
         renderer->vkDestroyInstance(renderer->instance, NULL);
     }
 #ifdef HAVE_GPU_OPENXR
-    if (xr) {
+    if (instancePfns) {
         instancePfns->xrDestroyInstance(xrInstance);
         SDL_free(instancePfns);
         SDL_OPENXR_UnloadLoaderSymbols();

@Beyley
Copy link
Author

Beyley commented Jan 10, 2025

Got a working Windows VM with a dedicated GPU passed through, so I'm going to start working on D3D12 support. Regarding Metal, I still don't have the hardware for working on that, so someone else will have to work on that.

@Beyley
Copy link
Author

Beyley commented Jan 10, 2025

Made a bunch of progress on the D3D12 backend, it's now rendering to the screen successfully (at least the BasicVr sample is, I havent tested my game on it), however there's a bunch of validation errors relating to resource states.

Need to take a deeper look tomorrow into how rendering to images is internally handled in SDL_gpu's D3D12 backend.

D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using ID3D12DebugCommandList1::AssertResourceState on Command List (0x000001BFB756D000:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x000001BFB6E51010:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a INITIAL|PRESENT.  Expected State Bits (all): 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using ResourceBarrier on Command List (0x000001BFB756D000:'Unnamed ID3D12GraphicsCommandList Object'): Before state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x000001BFB6E51010:'Unnamed ID3D12Resource Object') (subresource: 0) specified by transition barrier does not match with the state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) specified in the previous call to ResourceBarrier [ RESOURCE_MANIPULATION ERROR #527: RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH]
D3D12 WARNING: ID3D12CommandList::ClearRenderTargetView: The application did not pass any clear value to resource creation. The clear operation is typically slower as a result; but will still clear to the desired value. [ EXECUTION WARNING #820: CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE]

@rpavlik
Copy link

rpavlik commented Jan 10, 2025

Feel free to ping me or come to the OpenXR forum if you have questions on the OpenXR side. https://community.khronos.org/c/openxr/25

@Beyley
Copy link
Author

Beyley commented Jan 22, 2025

Congrats on everyone on the SDL 3.0 release! Just rebased my work on latest main to bring it up to date. Still haven't resolved the issues with the D3D12 driver yet, but the VK one still works great after the rebase.

Something I noticed on Windows when working on the D3D12 driver is that OpenXR's loader when compiled in debug mode produces a DLL named openxr_loaderd.dll, which is different than the release name of openxr_loader.dll. How should I handle this in SDL's OpenXR DLL loading code? Should I try release -> debug (may not pick the one the developer wants if the actual loader is installed system wide), or should i try debug -> release (which may adversely pick up a local debug build of the loader when the user wants a release version stored system wide).

@madebr
Copy link
Contributor

madebr commented Jan 22, 2025

Something I noticed on Windows when working on the D3D12 driver is that OpenXR's loader when compiled in debug mode produces a DLL named openxr_loaderd.dll, which is different than the release name of openxr_loader.dll. How should I handle this in SDL's OpenXR DLL loading code? Should I try release -> debug (may not pick the one the developer wants if the actual loader is installed system wide), or should i try debug -> release (which may adversely pick up a local debug build of the loader when the user wants a release version stored system wide).

This is done here in OpenXR-SDK. SDL2's CMake script also does this, which was undone immediately after the SDL3 fork creation.
I'd ask Khronos, but the sensible way is to always use openxr_loader.dll (without suffix) and require openxr-loader to be configured with -DOPENXR_DEBUG_POSTFIX=.

@Beyley
Copy link
Author

Beyley commented Jan 23, 2025

the sensible way is to always use openxr_loader.dll (without suffix) and require openxr-loader to be configured with -DOPENXR_DEBUG_POSTFIX=.

Makes sense, although, when using the OpenXR SDK through vcpkg+cmake, it does not seem possible to tell it to give you the non-debug binaries always. When building your app for debug, ittl always provide you with openxr_loaderd.dll. I'd imagine this would be a common enough issue to cause confusion. Likely should document somewhere (maybe provide a hint to change the loaded lib path aswell?) that we require the non-suffix version, although not sure where exactly that would be best to do.

@madebr
Copy link
Contributor

madebr commented Jan 23, 2025

the sensible way is to always use openxr_loader.dll (without suffix) and require openxr-loader to be configured with -DOPENXR_DEBUG_POSTFIX=.

Makes sense, although, when using the OpenXR SDK through vcpkg+cmake, it does not seem possible to tell it to give you the non-debug binaries always. When building your app for debug, ittl always provide you with openxr_loaderd.dll. I'd imagine this would be a common enough issue to cause confusion. Likely should document somewhere (maybe provide a hint to change the loaded lib path aswell?) that we require the non-suffix version, although not sure where exactly that would be best to do.

I asked the openxr developers here

@madebr
Copy link
Contributor

madebr commented Jan 23, 2025

Looks like the OpenXR devs are not confident on this topic. They'd require extra testing to make sure mixing MSVC CRT's works.
They suggested attempting to load both names. Perhaps we should turn the library name into a hint, use openxr_loader.dll by default? Perhaps the hint can accept a comma separated list of dlls?

@Beyley
Copy link
Author

Beyley commented Jan 23, 2025

Perhaps we should turn the library name into a hint, use openxr_loader.dll by default? Perhaps the hint can accept a comma separated list of dlls?

This seems reasonable to me, I'll do that. I likely should document this somewhere aswell, but not sure where would be best.

@madebr
Copy link
Contributor

madebr commented Jan 24, 2025

Perhaps also add libopenxr-dev (for Ubuntu) and openxr-devel (for Fedora) to README-linux.md?
And add libopenxr-dev to .github/workflows/create-test-plan.py. (The first list is for Ubuntu 20.04+, the second list is 22.04+.

@Beyley
Copy link
Author

Beyley commented Jan 24, 2025

Perhaps also add libopenxr-dev (for Ubuntu) and openxr-devel (for Fedora) to README-linux.md? And add libopenxr-dev to .github/workflows/create-test-plan.py. (The first list is for Ubuntu 20.04+, the second list is 22.04+.

I don't believe we need to, as I vendored the OpenXR headers same as was done for Vulkan. So we don't actually need the OpenXR dev packages on the host when compiling to get an OpenXR-enabled SDL.

@madebr
Copy link
Contributor

madebr commented Jan 24, 2025

I don't believe we need to, as I vendored the OpenXR headers same as was done for Vulkan. So we don't actually need the OpenXR dev packages on the host when compiling to get an OpenXR-enabled SDL.

Right, the page does not have a run-time depencies section.

src/gpu/xr/SDL_openxrdyn.c Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@@ -435,6 +435,7 @@
#cmakedefine SDL_GPU_D3D12 1
#cmakedefine SDL_GPU_VULKAN 1
#cmakedefine SDL_GPU_METAL 1
#cmakedefine HAVE_GPU_OPENXR 1
Copy link
Contributor

@madebr madebr Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add this to SDL_build_config_android.h and SDL_build_config_windows.h.

Does SDL_build_config_macos.h/ios.h also need it? Or doesn't this work on top of MoltenVK?

I'm not sure about SDL_build_config_xbox.h and wingdk.h. You're adding a d3d12 backend here, so it can work. But loading shared libraries will not work (on xbox) (but I'm not a specialist, so don't quote me)

Copy link
Author

@Beyley Beyley Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it for the Windows and Android build configs.

Does SDL_build_config_macos.h/ios.h also need it?

For now, it's not necessary per-se.

Theoretically the openxrdyn bits should work fine as-is on MacOS/iOS (assuming you can dynamically load on iOS, I've never written for that platform), and once someone writes OpenXR support into the Metal backend (MoltenVK does not work due to missing extensions last I heard), it should just kick into action.

I'm not sure about SDL_build_config_xbox.h and wingdk.h. You're adding a d3d12 backend here, so it can work.

afaik, there's no OpenXR loader or headset for the Xbox, so it probably shouldnt have it. It'd just be dead weight on that platform.

I've heard secondhand for the PS5 there is an OpenXR compatibility layer allowing you to develop using it for the PSVR2 on PS5, but I dont have the developer credentials to actually see what that looks like, or much of anything about it. So if someone comes around wanting SDL_gpu OpenXR support on PS5, I'm not sure how well the current code would be suited to support that. Ideally someone with PS5 developer credentials comes around and gives pointers for what would need to be changed before merging to make that path more accessible in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants