v3dv: Avoid swapchain_info handling on Android

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>
This commit is contained in:
Roman Stratiienko 2022-08-04 12:59:01 +03:00 committed by Marge Bot
parent b17ea48f91
commit a9556f97da
2 changed files with 10 additions and 1 deletions

View 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]);
}
}

View 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);