From e3dd6a33ed6244c64a44dc41b11464d5945e0fcc Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 9 Apr 2020 16:21:25 -0600 Subject: Revert "icd: Make swapchain images persistent" This reverts commit b40274e4. This caused the VkLayerTest.SwapchainAcquireTooManyImages2KHR test to fail, blocking CI. Change-Id: Ie0b5002544f0e467dd6d45beba9063ec96c73f67 --- scripts/mock_icd_generator.py | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 1686d089..623b89f8 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -64,9 +64,6 @@ static VkPhysicalDevice physical_device = (VkPhysicalDevice)CreateDispObjHandle( static unordered_map>> queue_map; static unordered_map> buffer_map; -static constexpr uint32_t icd_swapchain_image_count = 2; -static std::unordered_map swapchain_image_map; - // TODO: Would like to codegen this but limits aren't in XML static VkPhysicalDeviceLimits SetLimits(VkPhysicalDeviceLimits *limits) { limits->maxImageDimension1D = 4096; @@ -879,32 +876,23 @@ CUSTOM_C_INTERCEPTS = { mapped_memory_map.erase(memory); ''', 'vkGetImageSubresourceLayout': ''' - // Need safe values. Callers are computing memory offsets from pLayout, with no return code to flag failure. + // Need safe values. Callers are computing memory offsets from pLayout, with no return code to flag failure. *pLayout = VkSubresourceLayout(); // Default constructor zero values. ''', -'vkCreateSwapchainKHR': ''' - unique_lock_t lock(global_lock); - *pSwapchain = (VkSwapchainKHR)global_unique_handle++; - for(uint32_t i = 0; i < icd_swapchain_image_count; ++i){ - swapchain_image_map[*pSwapchain][i] = (VkImage)global_unique_handle++; - } - return VK_SUCCESS; -''', -'vkDestroySwapchainKHR': ''' - unique_lock_t lock(global_lock); - swapchain_image_map.clear(); -''', 'vkGetSwapchainImagesKHR': ''' + constexpr uint32_t icd_image_count = 2; + if (!pSwapchainImages) { - *pSwapchainImageCount = icd_swapchain_image_count; + *pSwapchainImageCount = icd_image_count; } else { unique_lock_t lock(global_lock); - for (uint32_t img_i = 0; img_i < (std::min)(*pSwapchainImageCount, icd_swapchain_image_count); ++img_i){ - pSwapchainImages[img_i] = swapchain_image_map.at(swapchain)[img_i]; + for (uint32_t img_i = 0; img_i < (std::min)(*pSwapchainImageCount, icd_image_count); ++img_i){ + // For simplicity always returns new handles, which is wrong + pSwapchainImages[img_i] = (VkImage)global_unique_handle++; } - if (*pSwapchainImageCount < icd_swapchain_image_count) return VK_INCOMPLETE; - else if (*pSwapchainImageCount > icd_swapchain_image_count) *pSwapchainImageCount = icd_swapchain_image_count; + if (*pSwapchainImageCount < icd_image_count) return VK_INCOMPLETE; + else if (*pSwapchainImageCount > icd_image_count) *pSwapchainImageCount = icd_image_count; } return VK_SUCCESS; ''', -- cgit v1.2.3