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

steam_helper: clean up OpenVR before getting OpenXR extensions in initialize_vr_data #8126

Open
wants to merge 1 commit into
base: proton_9.0
Choose a base branch
from

Conversation

emily-is-my-username
Copy link

@emily-is-my-username emily-is-my-username commented Sep 29, 2024

When using OpenComposite, both OpenVR and OpenXR functions may call the same underlying OpenXR loader.

Because the OpenXR loader only supports a single active instance, initialize_vr_data currently fails as an OpenXR instance has already been initialized at the time XR extensions are queried.

This commit fixes the problem by cleaning up the temporary OpenVR context before initializing OpenXR instead of keeping it open until the end of the call.

Fix for:
#7905


This is a follow-up to #7906.

As @gofman suggested, it is much simpler and safer to just close the OpenVR instance early than what I did before.

Tested with:

  • VRChat (OpenVR) + Proton + SteamVR
  • Beat Saber (OpenXR) + Proton + SteamVR
  • Beat Saber (OpenXR) + Proton + OpenComposite + Monado (this one was broken before)

…itialize_vr_data`

When using OpenComposite, both OpenVR and OpenXR functions may
call the same underlying OpenXR loader.

Because the OpenXR loader only supports a single active instance,
`initialize_vr_data` currently fails as an OpenXR instance
has already been initialized ath the time XR extensions are queried.

This commit fixes the problem by cleaning up the temporary
OpenVR context *before* initializing OpenXR instead of keeping it
open until the end of the call.

Fix for:
ValveSoftware#7905
@emily-is-my-username
Copy link
Author

@gofman

I'm sorry for the long delay, but I finally found some time to try out your suggestion. It works as expected AFAICT, thank you for the guidance.

Regarding your comment about real names: I have no intention to use my real, full name on this account and I also don't want to pretend that I do :)

If your offer to pull this under your name still stands, you have my permission to do so. That goes for anyone who would be willing to do so.

@emily-is-my-username
Copy link
Author

@eburema were you able to compile proton yet? On my machine, the docker/podman build worked fine as long as my git repo and build dir were fresh. The problems I had were always caused by:

  • having an unclean build directory (run make clean)
  • having unclean git submodules (especially nested ones) after switching branches / commits (run git submodule update --init --recursive, verify with git status)

Plagman pushed a commit that referenced this pull request Oct 3, 2024
…itialize_vr_data`

Patch written by Emily <[email protected]>

#8126

When using OpenComposite, both OpenVR and OpenXR functions may
call the same underlying OpenXR loader.

Because the OpenXR loader only supports a single active instance,
`initialize_vr_data` currently fails as an OpenXR instance
has already been initialized ath the time XR extensions are queried.

This commit fixes the problem by cleaning up the temporary
OpenVR context *before* initializing OpenXR instead of keeping it
open until the end of the call.

Fix for:
#7905

Signed-off-by: Paul Gofman <[email protected]>
@gofman
Copy link

gofman commented Oct 3, 2024

Thanks! I pushed the patch, it is in Experimental [bleeding-edge] now: 5b26b6a

@eburema
Copy link

eburema commented Oct 7, 2024

Finally managed to compile proton (was in the end a user error), and tested this new addition to bleeding edge with both OpenComposite + Monado, and SteamVR. Patch seems to be working fine on my end (OpenXR games started to work in OC + Monado, and nothing broke in SteamVR)

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.

3 participants