Mesa (master): venus: cap api version to 1.1 for Android

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 15 18:38:13 UTC 2021


Module: Mesa
Branch: master
Commit: d148540e5ab2faf59890c1c41571f03a0b14db7e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d148540e5ab2faf59890c1c41571f03a0b14db7e

Author: Yiwei Zhang <zzyiwei at chromium.org>
Date:   Thu Apr 15 17:14:11 2021 +0000

venus: cap api version to 1.1 for Android

Android hasn't officially adopted 1.2 yet, so we just cap it to avoid
troubles(e.g. vkjson doesn't like 1.2 atm).

Signed-off-by: Yiwei Zhang <zzyiwei at chromium.org>
Reviewed-by: Chia-I Wu <olvaffe at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10258>

---

 src/virtio/vulkan/vn_device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c
index d34c11d4a81..17cc2a73b43 100644
--- a/src/virtio/vulkan/vn_device.c
+++ b/src/virtio/vulkan/vn_device.c
@@ -1250,6 +1250,11 @@ vn_physical_device_init_properties(struct vn_physical_device *physical_dev)
          props->apiVersion = VK_HEADER_VERSION_COMPLETE;
       if (props->apiVersion > vn_info_vk_xml_version())
          props->apiVersion = vn_info_vk_xml_version();
+#ifdef ANDROID
+      if (props->apiVersion >= VK_API_VERSION_1_2)
+         props->apiVersion =
+            VK_MAKE_VERSION(1, 1, VK_VERSION_PATCH(props->apiVersion));
+#endif
    }
 
    props->driverVersion = vk_get_driver_version();



More information about the mesa-commit mailing list