Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e18ba82 authored by Chris Forbes's avatar Chris Forbes
Browse files

vulkan: return OUT_OF_DATE from GetSwapchainStatus if not current

We don't yet have good ways to detect other ways in which the swapchain
may have gone bad, but it's easy to detect the case where the swapchain
is not current for the surface it targets.

Test: build
Change-Id: Id882a4a699d65f323e8a5e181f0e25e903039f21
parent c48f42c8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1314,9 +1314,14 @@ VkResult GetPastPresentationTimingGOOGLE(
VKAPI_ATTR
VkResult GetSwapchainStatusKHR(
    VkDevice,
    VkSwapchainKHR) {
    VkSwapchainKHR swapchain_handle) {
    Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle);
    VkResult result = VK_SUCCESS;

    if (swapchain.surface.swapchain_handle != swapchain_handle) {
        return VK_ERROR_OUT_OF_DATE_KHR;
    }

    // TODO(chrisforbes): Implement this function properly

    return result;