summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-08-31 16:17:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-08-31 16:17:21 +0000
commit1f251f134e9d3ca2f2a706d4ee13919de412373d (patch)
treef392684837068ce9d4e1812769c18315b5cff3d6
parentae01ea5aea14a038488bb76c4f0bbcb65d1d43ac (diff)
parentef14146f7de705c2facfc8c470ea100503dbdb57 (diff)
downloadnative-1f251f134e9d3ca2f2a706d4ee13919de412373d.tar.gz
Merge "swapchain: always return a signle image for shared presentation mode" into sc-qpr1-dev
-rw-r--r--vulkan/libvulkan/swapchain.cpp6
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;