Add support for the OpenXR futures extension#101951
Add support for the OpenXR futures extension#101951akien-mga merged 1 commit intogodotengine:masterfrom
Conversation
There was a problem hiding this comment.
For now exposing this way, this is really only for GDExtensions that need to access this class.
Thinking about alternatively adding a method to OpenXRAPIExtension where we can retrieve any registered extension, but this would lead to needed to register all extension classes in ClassDB.
There was a problem hiding this comment.
Decided to do this as a proper GDScript singleton
2b3d5cb to
0a7482d
Compare
There was a problem hiding this comment.
I had to do a bunch of these changes as it seems metadata is a class member of Object (or introduced by our ClassDB macro). Bit of a PITA.
3666bc8 to
fd2375e
Compare
devloglogan
left a comment
There was a problem hiding this comment.
Wanted to take a quick look through this. Looks cool and makes sense to me! Would be curious to try this out with a relevant API sometime but in the spec it looks like it's only used by Magic Leap currently?
It's used by a number of APIs still in development, but it will be some time before those are public. |
319d3f9 to
f0436b1
Compare
|
As part of the change to have
Maybe it makes sense to spin the " UPDATE: The crash related to multiple inheritance that I was referring to in point nr 1 was issue #88613 fixed by PR #88689 |
|
@dsnopek the crash issues were caused by a moving pointer between the different classes because of late introduction of a v-table. My main worry with point 1 is that we'll end up looping through all wrappers just to find out only one or two actually have compositor logic. For point 2, it's definitely worth doing a follow up to clean up |
I'm not saying to get rid of the registration for the extensions that affect compositor layers. Just that it would take
We do it both ways for different things in Godot. The only advantage of keeping it abstract (as opposed to virtual) is that users could try to extend |
f0436b1 to
a2e437a
Compare
|
Ok, I've made this ready for proper review. Been testing this for the past few weeks and it is working fine. Sadly can't share the project I'm working on just yet. I did change things so it properly uses @dsnopek I've left the classes as they are for now, I do think we need to look into this further but changing those would be serious breaking changes, especially the *extension change. I do hear what you're saying here though so far in all my discussions with the core team I get two answers, some always wanting the specific extension classes and others saying its find to just make the base class virtual. I'm not bothered one way or the other. But changing it now will break our existing vendor extension and I think that's not worth it. Also it will require a bunch of other cleanup that I'd rather do in a separate PR if we decide to go down this route. |
a2e437a to
8162bf6
Compare
I'm happy to make a follow-up PR! However, the changes I described above would not be breaking changes - they should be fully backwards compatible. The vendor extension should be able to keep working without any changes |
dsnopek
left a comment
There was a problem hiding this comment.
Other than some little nitpicky stuff in the API, this looks good to me!
|
@dsnopek I still have to test it but have a look at the future result implementation I did and see if this matches your expectation. |
2e04487 to
5c1feec
Compare
dsnopek
left a comment
There was a problem hiding this comment.
Thanks!
The addition of the result object looks great - that will be really nice to use from GDScript :-)
This is all looking good to me!
I did it as a separate commit so you can rebase your changes ontop of it.
You can squash them - I should be able to rebase fine
5c1feec to
bc97a47
Compare
|
Squashed the commits into one. I think this is ok to merge. |
291b136 to
2ffaac1
Compare
2ffaac1 to
d631218
Compare
|
Thanks! |
This PR introduces the OpenXR Future extension which allows asynchronous calls into APIs from extensions that use the future extension.
When a future is created as an asynchronous function call is made, we can register this future with a callable that will be invoked when the function call finishes.
As Godot requires that classes inherit from Godots
Objectclass for callables to work. This PR also changesOpenXRExtensionWrapperto inherit fromObjectand updates all existing extension classes accordingly.OpenXRExtensionWrapperExtensionis also changed to now just inherit fromOpenXRExtensionWrapper. Outwardly this shouldn't change and shouldn't break existing GDExtension based OpenXR extension wrappers but this does need to be tested.This PR will remain in draft until testing is done with APIs that apply the future approach and I can confirm this is the correct way to go forward. Looking for feedback from other core XR devs.
Contributed by Khronos Group through the Godot Integration Project