diff options
author | Ady Abraham <adyabr@google.com> | 2021-08-26 13:12:30 -0700 |
---|---|---|
committer | Ady Abraham <adyabr@google.com> | 2021-08-26 21:45:00 +0000 |
commit | ef14146f7de705c2facfc8c470ea100503dbdb57 (patch) | |
tree | 17a1eac061a91ee68f86894296cc5152bcb7c3b2 | |
parent | 3819b9fe0b052b29af2bd86d2be907023c6df7f9 (diff) | |
download | native-ef14146f7de705c2facfc8c470ea100503dbdb57.tar.gz |
swapchain: always return a signle image for shared presentation mode
Bug: 197790618
Test: atest CtsDeqpTestCases -- --module-arg CtsDeqpTestCases:include-filter:dEQP-VK.wsi.android.*
Change-Id: If3c086479dfc03af31f503216294eba4fba989de
-rw-r--r-- | vulkan/libvulkan/swapchain.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp index 271558784e..3ed3eba767 100644 --- a/vulkan/libvulkan/swapchain.cpp +++ b/vulkan/libvulkan/swapchain.cpp @@ -1231,6 +1231,12 @@ VkResult CreateSwapchainKHR(VkDevice device, return VK_ERROR_SURFACE_LOST_KHR; } + // In shared mode the num_images must be one regardless of how many + // buffers were allocated for the buffer queue. + if (swapchain_image_usage & VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID) { + num_images = 1; + } + int32_t legacy_usage = 0; if (dispatch.GetSwapchainGrallocUsage2ANDROID) { uint64_t consumer_usage, producer_usage; |