v3dv: Avoid swapchain_info handling on Android
authorRoman Stratiienko <r.stratiienko@gmail.com>
Thu, 4 Aug 2022 09:59:01 +0000 (12:59 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 18 Aug 2022 22:03:04 +0000 (22:03 +0000)
Allows following tests to pass.
dEQP-VK.wsi.android.swapchain.create#image_swapchain_create_info
dEQP-VK.wsi.android.swapchain.simulate_oom#image_swapchain_create_info

Venus code was used as example.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18047>

src/broadcom/vulkan/v3dv_device.c
src/broadcom/vulkan/v3dv_image.c

index 5016f17..e85a83a 100644 (file)
@@ -2495,6 +2495,7 @@ v3dv_BindImageMemory2(VkDevice _device,
                       const VkBindImageMemoryInfo *pBindInfos)
 {
    for (uint32_t i = 0; i < bindInfoCount; i++) {
+#ifndef ANDROID
       const VkBindImageMemorySwapchainInfoKHR *swapchain_info =
          vk_find_struct_const(pBindInfos->pNext,
                               BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR);
@@ -2509,7 +2510,9 @@ v3dv_BindImageMemory2(VkDevice _device,
             .memoryOffset = swapchain_image->mem_offset,
          };
          bind_image_memory(&swapchain_bind);
-      } else {
+      } else
+#endif
+      {
          bind_image_memory(&pBindInfos[i]);
       }
    }
index 0f024fa..18abc84 100644 (file)
@@ -416,8 +416,14 @@ v3dv_CreateImage(VkDevice _device,
 {
    V3DV_FROM_HANDLE(v3dv_device, device, _device);
 
+#ifdef ANDROID
+   /* VkImageSwapchainCreateInfoKHR is not useful at all */
+   const VkImageSwapchainCreateInfoKHR *swapchain_info = NULL;
+#else
    const VkImageSwapchainCreateInfoKHR *swapchain_info =
       vk_find_struct_const(pCreateInfo->pNext, IMAGE_SWAPCHAIN_CREATE_INFO_KHR);
+#endif
+
    if (swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE)
       return create_image_from_swapchain(device, pCreateInfo, swapchain_info,
                                          pAllocator, pImage);