From: Normunds Rieksts Date: Wed, 27 Oct 2021 14:47:08 +0000 (+0100) Subject: Ensure that swapchain is not passed to the ICD when creating images X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bf469a278eef55eeef68ef2c88597194f06d87e;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git Ensure that swapchain is not passed to the ICD when creating images Ensures that all images created from a headless swapchain use the same vkImageCreate info. This ensures that when calling vkCreateImage with a swapchain that is owned by the layer the VkImageSwapchainCreateInfoKHR is not passed further down the chain to ICD on headless implementation. Change-Id: I1bd723589e52577b98fd53ec1ec769e5594a0838 Signed-off-by: Normunds Rieksts --- diff --git a/wsi/headless/swapchain.cpp b/wsi/headless/swapchain.cpp index b1033e9..1005809 100644 --- a/wsi/headless/swapchain.cpp +++ b/wsi/headless/swapchain.cpp @@ -49,6 +49,7 @@ struct image_data swapchain::swapchain(layer::device_private_data &dev_data, const VkAllocationCallbacks *pAllocator) : wsi::swapchain_base(dev_data, pAllocator) + , m_image_create_info() { } @@ -60,7 +61,7 @@ swapchain::~swapchain() VkResult swapchain::create_aliased_image_handle(const VkImageCreateInfo *image_create_info, VkImage *image) { - return m_device_data.disp.CreateImage(m_device, image_create_info, get_allocation_callbacks(), image); + return m_device_data.disp.CreateImage(m_device, &m_image_create_info, get_allocation_callbacks(), image); } VkResult swapchain::create_and_bind_swapchain_image(VkImageCreateInfo image_create, wsi::swapchain_image &image) @@ -68,6 +69,7 @@ VkResult swapchain::create_and_bind_swapchain_image(VkImageCreateInfo image_crea VkResult res = VK_SUCCESS; const std::lock_guard lock(m_image_status_mutex); + m_image_create_info = image_create; res = m_device_data.disp.CreateImage(m_device, &image_create, get_allocation_callbacks(), &image.image); if (res != VK_SUCCESS) { diff --git a/wsi/headless/swapchain.hpp b/wsi/headless/swapchain.hpp index cdaf792..fb663b9 100644 --- a/wsi/headless/swapchain.hpp +++ b/wsi/headless/swapchain.hpp @@ -119,6 +119,12 @@ protected: */ VkResult bind_swapchain_image(VkDevice &device, const VkBindImageMemoryInfo *bind_image_mem_info, const VkBindImageMemorySwapchainInfoKHR *bind_sc_info) override; + +private: + /** + * @brief Image creation info used for all swapchain images. + */ + VkImageCreateInfo m_image_create_info; }; } /* namespace headless */