nvk/android: Add support for ANDROID_native_buffer
Implementation
ANB implementation aims to rely as much as possible on 'ANB common' code in vulkan/runtime and vk_common_* entry points automatically handled by mesa at build time.
Coding style was inspired by other drivers using ANB common helpers (lvp, panvk, tu, v3dv) Thanks to contributors of ANB common helpers.
Organized in 4 commits as follows:
"nvk/android: Add initial support for ANDROID_native_buffer"
"nvk/android: Advertise Vulkan 1.1 for Android 12L and lower"
"nvk: Change nvk_image to use common initialization helpers"
"nvk/android: use ANB common code for GetSwapchainGrallocUsage*ANDROID"
Achievements:
Vulkan Apps are rendering on screen (Tested on Android 11 with Vulkan 1.1 API)
Tested on RTX2060, GT1030 and GTX950
Android apps working:
Khronos Vulkan-Samples
Sacha Willems Vulkan Examples
Vulkan Android Test
vkCube
GearsVK
PPSSPP
3DMARK API Overhead/3DMARK Slingshot Extreme - Running but with meshes issue
dEQP Test Results (details of the failed tests are in the commit messages):
Module Passed Failed Total
dEQP-VK 568737 162 568899
Remaining doubts/outstanding work:
Why are the meshes missing in 3DMARK API Overhead/3DMARK Slingshot Extreme?
Sometimes Android apps take a lot of time to render on screen, other times are instantaneus
What is the max number of planes supported by NVK? At the moment I started with 1
nvk_CreateImage seems to process images that are not ANB, is this correct or am I missing some code paths in my implementation?
08-21 22:04:01.647 6035 6062 I MESA : nvk_CreateImage: VkNativeBufferANDROID detected
08-21 22:04:01.649 6035 6062 I chatty : uid=10191(com.jeffboody.gearsvk) Thread-2 identical 45 lines
08-21 22:04:01.649 6035 6062 I MESA : nvk_CreateImage: VkNativeBufferANDROID detected
08-21 22:04:01.650 6035 6062 W MESA : nvk_CreateImage: VkNativeBufferANDROID NOT detected
08-21 22:04:01.652 6035 6062 W MESA : nvk_CreateImage: VkNativeBufferANDROID NOT detected
Please review and provide comments/suggestions