GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
102 stars 24 forks source link

Questions regarding the implementation of the Meta Environment Depth #220

Open SixArne opened 1 week ago

SixArne commented 1 week ago

Hi, I noticed that the Meta Environment Depth API is not in this repository yet so I tried to implement it, however I have a few questions:

Currently I am debugging with godot::UtilityFunctions::print(""); statements to see if everything is working correctly (because I assume that breakpointing isn't an option here). I have ran into a small issue regarding the OpenXR loader, this being that the OpenXR loader lib is only there for android and not for windows.

This isn't that big of an issue, but i don't wish to compile an android build every single time i want to test/debug something, I would prefer to test things in the Godot editor with quest link as long as possible, sadly with quest link it still uses the windows version.

The moment I use a statement like xrGetInstanceProcAddr (which will happen a lot) the windows gdextension will refuse to compile because of the missing lib file (missing symbols).

Does anyone know where I can add the lib file for windows myself? CMake isn't my strong suit (I already compiled it from openxr source repository)

You can find my latest changes in the fork.

https://github.com/SixArne/godot_openxr_vendors

Also some of the function calls are only available when XR_EXTENSION_PROTOTYPES is defined. Where is the best place to put this?

Also, when exporting to Android I get the following error (And i tried to add --stacktrace or --info the the export process but without any improvement)

  * What went wrong:
  Could not open cp_settings generic class cache for settings file 'C:\Dev\metadepthtesting\android\build\settings.gradle' (C:\Users\sixar\.gradle\caches\8.2\scripts\44rhs1fbso0wqjw3v8yq5xlct).
  > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 67

  * Try:
  > Run with --stacktrace option to get the stack trace.
  > Run with --info or --debug option to get more log output.
  > Run with --scan to get full insights.
  > Get more help at https://help.gradle.org.

  BUILD FAILED in 674ms

image

SixArne commented 1 week ago
void OpenXRMetaEnvironmentDepthProvider::enumerate_depth_swapchain_images()
{
    // TODO: Look into iteration, probably in process while the depth provider is working?

    // XrResult result = xrEnumerateEnvironmentDepthSwapchainImagesMETA(
    //     m_environmentDepthSwapchain,
    //     uint32_t imageCapacityInput,
    //     uint32_t* imageCountOutput,
    //     XrSwapchainImageBaseHeader* images); //STUB - This might need to be tightly linked to the actual vulkan rendering, which at first glance seems out of reach
    //                                          // for GDExtension?
}

So I am wondering if this will be the limit of GDExtension. Not 100% sure but it looks like XrSwapchainImageBaseHeader is at the engine level.