- Home /
Can't get Android to connect to Vulkan in NDK plugin
I've been trying to adapt https://github.com/Unity-Technologies/NativeRenderingPlugin to get an interface into the Vulkan Graphics Interface but for some reason it can't get the interface for Vulkan to work on Android. I've tried several variations, 32 bit or 64 bit, Unity 2018.4 or 2020.1, Mono or il2cpp, changing min android version to 19 or 26, but the demo just crashes. Works fine for OpenGL
When I step through UnityPluginLoad s_Graphics is set to a valid interface for IUnityGraphics s_Graphics->GetRenderer() is returning kUnityGfxRendererVulkan as expected but unityInterfaces->Get<IUnityGraphicsVulkan>()
is returning NULL I've checked, it's not a matter of timing, because even if I call s_UnityInterfaces->Get<IUnityGraphicsVulkan>()
at a later frame, it's still 0
The only thing I can think of, is the GUID is incorrect in IUnityGraphicsVulkan Can you confirm at least that it is as stated in the header file UNITY_REGISTER_INTERFACE_GUID(0x95355348d4ef4e11ULL, 0x9789313dfcffcc87ULL, IUnityGraphicsVulkan) as I can't think of a way to confirm it myself, as I don't think you can get a list of registered interfaces. I know it must be possible to get a working interface to Unity Vulkan from NDK, as I have seen it in other projects. We have developed a plugin for Unity, and since the default renderer for 2019 + is now Vulkan, rather than OpenGL, we can't really insist on people using OpenGL for their projects. Any hints on how to fix this, would be appreciated. James
I have since been told, this interface with that address only works on 2019, which I can confirm, my POC did work in 2019. Does anyone have any details on how to get it to work on other variations of Unity?
Your answer
Follow this Question
Related Questions
Android Multi-Plugins 0 Answers
How to alter the Android Manifest to use my ad-displaying activity in Unity? 0 Answers
Update Notification 1 Answer
Communicate with Android native plugin 0 Answers