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

Commit 0b468473 authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

Vulkan: fix vkQueuePresentKHR logic when queueBuffer fails

Bug: 134185757
Test: CtsDeqpTestCases and CtsGraphicsTestCases
Change-Id: I181b926fa39f10918ef87a11687ba987e7e350f8
parent 533cea9f
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1666,17 +1666,16 @@ VkResult QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info) {
                err = window->queueBuffer(window, img.buffer.get(), fence);
                // queueBuffer always closes fence, even on error
                if (err != 0) {
                    // TODO(jessehall): What now? We should probably cancel the
                    // buffer, I guess?
                    ALOGE("queueBuffer failed: %s (%d)", strerror(-err), err);
                    swapchain_result = WorstPresentResult(
                        swapchain_result, VK_ERROR_OUT_OF_DATE_KHR);
                }
                } else {
                    if (img.dequeue_fence >= 0) {
                        close(img.dequeue_fence);
                        img.dequeue_fence = -1;
                    }
                    img.dequeued = false;
                }

                // If the swapchain is in shared mode, immediately dequeue the
                // buffer so it can be presented again without an intervening
@@ -1703,7 +1702,6 @@ VkResult QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info) {
                }
            }
            if (swapchain_result != VK_SUCCESS) {
                ReleaseSwapchainImage(device, window, fence, img);
                OrphanSwapchain(device, &swapchain);
            }
            int window_transform_hint;