Mesa (main): anv: don't try to access Android swapchains

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 5 18:32:48 UTC 2021


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

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Thu Aug  5 18:10:15 2021 +0300

anv: don't try to access Android swapchains

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5180
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12217>

---

 src/intel/vulkan/anv_image.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 9d58fa968c5..a93542ba244 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1477,11 +1477,17 @@ anv_CreateImage(VkDevice device,
       return anv_image_from_gralloc(device, pCreateInfo, gralloc_info,
                                     pAllocator, pImage);
 
+#ifndef VK_USE_PLATFORM_ANDROID_KHR
+   /* Ignore swapchain creation info on Android. Since we don't have an
+    * implementation in Mesa, we're guaranteed to access an Android object
+    * incorrectly.
+    */
    const VkImageSwapchainCreateInfoKHR *swapchain_info =
       vk_find_struct_const(pCreateInfo->pNext, IMAGE_SWAPCHAIN_CREATE_INFO_KHR);
    if (swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE)
       return anv_image_from_swapchain(device, pCreateInfo, swapchain_info,
                                       pAllocator, pImage);
+#endif
 
    return anv_image_create(device,
       &(struct anv_image_create_info) {



More information about the mesa-commit mailing list