I always thought that on android platform we were supposed to load the pointer to Vulkan library using dlopen()
and dlsym()
(something like that:
libVulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
vkEnumerateInstanceExtensionProperties = reinterpret_cast<PFN_vkEnumerateInstanceExtensionProperties(dlsym(libVulkan,"vkEnumerateInstanceExtensionProperties"));
(source: https://github.com/SaschaWillems/Vulkan/blob/master/base/VulkanAndroid.cpp)
)
or by using the "vulkan_wrapper.h" dynamic loader (like in the Vulkan Android Samples by google https://github.com/googlesamples/android-vulkan-tutorials)
I was able to build and run the hello_xr sample on the oculus quest thanks to the blog of Gayan Ediriweera (https://gayanediriweera.github.io/code/2021/04/06/how-to-run-helloxr-on-oculus-quest.html)
However when I look at the code for the hello_xr sample for vulkan I haven't seen call to dlopen() or dlsym(). For example at line 1287 (https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/src/tests/hello_xr/graphicsplugin_vulkan.cpp), the sample call vkEnumerateInstanceLayerProperties
but I don't see where the pointer for this base function is loaded which is confusing me.
What is the kind of black magic that is going on here ? Does the OpenXR runtime load these under the hood or am I missing something in the code?
Thanks in advance for any help on this