Commit 5b2b2511 authored by Iason Paraskevopoulos's avatar Iason Paraskevopoulos
Browse files

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's avatarIason Paraskevopoulos <iason.paraskevopoulos@arm.com>
parent 9585b28b
Pipeline #239840 passed with stage
in 1 minute and 2 seconds
/*
* 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment