Open hammerandtongs opened 1 year ago
Is there any serious down side, performance wise or other, to including this switch?
Else I'd suggest instead of reacting to GODOT_ANDROID_XR_LOADER_DEBUG
we react to the debug build system already build into the AAR build scripts.
There is a problem here that needs to be solved in Core, unlike GDExternal, the gdap
file does not allow for specifying whether a debug or runtime build of a plugin should be included in the export. That is something that was discussed with the android team but currently on the list of todos for a future version.
That said, we can change the CI to make both runtime and debug builds and just have a godotopenxrloaders-runtime.zip
and godotopenxrloaders-debug.zip
that includes the different versions.
I think it makes a lot of sense to add this to debug builds but I was hoping for someone/anyone with a device to tell us it was ok and didn't fill up logs with silly spam :)
But also it would be kind of nice to find a place to document this "hack" to get working android environment variables for godot. Is there a faq or tips section for it?
I've been trying to hack in XR_LOADER_DEBUG=all
by calling setenv("XR_LOADER_DEBUG", "all", 1);
at the core initialization level, but it just doesn't seem like the loader on android is picking it up at all.
Since the environment variable situation is a bit of a mess on android, it might be better to just implement the XR_EXT_debug_utils
extension. This extension allows you to register a callback for debug messages, giving you much better control over the logging than the environment variable.
Exposing XR_LOADER_DEBUG might be useful for android XR debugging but android has restrictions on env use (each process has its own freestanding env).
https://registry.khronos.org/OpenXR/specs/1.0/loader.html#loader-debugging
I think the cleanest way to do that would be to modify the gradle build target something like
buildConfigField "String", "XR_LOADER_DEBUG", "\"${System.env.GODOT_ANDROID_XR_LOADER_DEBUG}\""
Then add GODOT_ANDROID_XR_LOADER_DEBUG to the build environment.
This could be checked in godotscript by
https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-get-environment
*Warning this is untested as I don't have an android XR device.