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

Cleanup OpenXR on initialisation failure #59466

Merged

Conversation

BastiaanOlij
Copy link
Contributor

On initialisation of OpenXR, which now happens way at the beginning of starting up Godot, if there was a failure it wouldn't clean things up and still try to set the rest of Godot up as if OpenXR was successfully setup.

This change ensure we clean up right away and Godot will start as normal. It would be nice if we just exist Godot all together at this point but there doesn't seem to be a clean way to do so. That said, the user can react on the initialise call on the interface failing and react accordingly.

OpenXR is a little strange when it comes to this.
With SteamVR if no headset is attached (because the user forgot to plug it in), instead of waiting and alerting the user, it just doesn't create the OpenXR instance and fails right off the bat.
The Oculus runtime gets a little further but will fail as we interrogate OpenXR and ask it to configure the session at this point saying that the requested mode is not available.

In both situations we now halt initialization and properly clean up resulting in Godot starting with OpenXR disabled.

@BastiaanOlij BastiaanOlij added this to the 4.0 milestone Mar 24, 2022
@BastiaanOlij BastiaanOlij force-pushed the cleanup_openxr_on_failure branch from 748017b to c78876f Compare March 25, 2022 07:31
@akien-mga akien-mga merged commit 3990152 into godotengine:master Mar 25, 2022
@akien-mga
Copy link
Member

Thanks!

@BastiaanOlij BastiaanOlij deleted the cleanup_openxr_on_failure branch March 25, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants