Can't get android to work with Vulkan
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, cpp, unity
- Domain
- computer-graphics, mobile-dev
Research direction
Start at UnityPluginLoad and inspect the IUnityGraphicsVulkan declaration and registered GUID in the header. Reproduce the Android Vulkan demo crash, comparing the interface lookup with the working OpenGL path. Done means the Vulkan interface is obtained on Android and the demo no longer crashes.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C
- Stars
- 946
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Unity-Technologies/NativeRenderingPlugin
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Unity-Technologies/NativeRenderingPlugin#46 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
Unity-Technologies/NativeRenderingPlugin#42 · 2 comments ·
All issues in Unity-Technologies/NativeRenderingPlugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dkfans/keeperfx#5415 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
void-linux/void-runit#141 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ARM-software/sysarch-acs#600 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day