Allow two images worth of alignment slop in protected heap
authorChris Forbes <chrisforbes@google.com>
Mon, 11 Jun 2018 22:50:16 +0000 (15:50 -0700)
committerChris Forbes <chrisforbes@google.com>
Mon, 11 Jun 2018 22:50:16 +0000 (15:50 -0700)
Bug: b/109757443
Test: dEQP-VK.protected_memory.interaction.wsi.android.swapchain.create#min_image_count
Change-Id: I01b3a72986e9f35b4ec15a146e4dc576758c02ce

external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp

index 229ad73..d0c3763 100644 (file)
@@ -291,10 +291,10 @@ std::vector<vk::VkSwapchainCreateInfoKHR> generateSwapchainParameterCases (vk::w
                        }
 
                        // If the implementation doesn't have a max image count, min+16 means we won't clamp.
-                       // Limit it to how many protected images we estimate can be allocated, with one image
-                       // worth of slack for alignment, swapchain-specific constraints, etc.
+                       // Limit it to how many protected images we estimate can be allocated, with two images
+                       // worth of slack for alignment, swapchainspecific constraints, etc.
                        const deUint32  maxImageCount           = de::min((capabilities.maxImageCount > 0) ? capabilities.maxImageCount : capabilities.minImageCount + 16u,
-                                                                                                                 deUint32(protectedHeapSize / memoryRequirements.size) - 1);
+                                                                                                                 deUint32(protectedHeapSize / memoryRequirements.size) - 2);
                        const deUint32  maxImageCountToTest     = de::clamp(16u, capabilities.minImageCount, maxImageCount);
                        for (deUint32 imageCount = capabilities.minImageCount; imageCount <= maxImageCountToTest; ++imageCount)
                        {