mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2025-12-27 23:10:10 +01:00
Fix erroneous behaviour in error cases
Corrects error handling when image creation fails and fixes shutdown behaviour in error cases. Change-Id: I29b9fbd237b90f6007e4731d9019efb6b4c256ff Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
This commit is contained in:
parent
9585b28b12
commit
5b2b2511f7
2 changed files with 12 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2019 Arm Limited.
|
||||
* Copyright (c) 2017-2020 Arm Limited.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
|
@ -61,7 +61,10 @@ VkResult swapchain::create_image(const VkImageCreateInfo &image_create, wsi::swa
|
|||
{
|
||||
VkResult res = VK_SUCCESS;
|
||||
res = m_device_data.disp.CreateImage(m_device, &image_create, nullptr, &image.image);
|
||||
assert(VK_SUCCESS == res);
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
VkMemoryRequirements memory_requirements;
|
||||
m_device_data.disp.GetImageMemoryRequirements(m_device, image.image, &memory_requirements);
|
||||
|
|
|
|||
|
|
@ -322,11 +322,17 @@ void swapchain_base::teardown()
|
|||
}
|
||||
|
||||
/* If descendant started presenting, there is no pending buffer in the swapchain. */
|
||||
if (descendent_started_presenting == false)
|
||||
if (m_is_valid && descendent_started_presenting == false)
|
||||
{
|
||||
wait_for_pending_buffers();
|
||||
}
|
||||
|
||||
if (m_queue != VK_NULL_HANDLE)
|
||||
{
|
||||
/* Make sure the vkFences are done signaling. */
|
||||
vkQueueWaitIdle(m_queue);
|
||||
}
|
||||
|
||||
/* Make sure the vkFences are done signaling. */
|
||||
m_device_data.disp.QueueWaitIdle(m_queue);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue