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

Commit 492dd5fc authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

vulkan: return VK_ERROR_SURFACE_LOST_KHR when queueBuffer fails

On Android, queueBuffer failure inside vkQueuePresentKHR is not quite
plausible. Previously, VK_ERROR_OUT_OF_DATE_KHR was returned when
queueBuffer failed, which ended up with app trying to get latest surface
caps again but failing with VK_ERROR_SURFACE_LOST_KHR. Per API contract
between Vulkan WSI and BufferQueue, queueBuffer failure inside
vkQueuePresentKHR should be treated as surface lost directly.

Bug: 178818988
Test: dEQP-VK.wsi.android.swapchain.*
Change-Id: Ifc5e58693aa0fe4abe01a9855d8d060dcce0b2f3
parent 5dc18f28
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1709,7 +1709,7 @@ VkResult QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info) {
                if (err != android::OK) {
                if (err != android::OK) {
                    ALOGE("queueBuffer failed: %s (%d)", strerror(-err), err);
                    ALOGE("queueBuffer failed: %s (%d)", strerror(-err), err);
                    swapchain_result = WorstPresentResult(
                    swapchain_result = WorstPresentResult(
                        swapchain_result, VK_ERROR_OUT_OF_DATE_KHR);
                        swapchain_result, VK_ERROR_SURFACE_LOST_KHR);
                } else {
                } else {
                    if (img.dequeue_fence >= 0) {
                    if (img.dequeue_fence >= 0) {
                        close(img.dequeue_fence);
                        close(img.dequeue_fence);