Can't get android to work with Vulkan
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
According to my research, Vulkan works fine in newly created projects with Unity2019.4 from Unity2019.1 and above. However, it does not work properly with newly created projects in Unity 2020.1 and above.
Ok, I can confirm that the demo works on 2019.2 and 2019.4, isn't that strange? Thanks for the info utibenkei. Looks like they have changed the interface (and perhaps the guid of the interface). I'll use 2019 to continue development for now, and raise it with support, because this is going into an SDK, can't really expect devs only to use 2019. A question I've raised on Unity/Community/Answers hasn't had a reply. I'll report back here what I find out, as I'm sure there are other frustrated Android devs out there.