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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

GPU: OpenXR integration #11601

wants to merge 14 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
  • 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?)

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.

1 participant