Loading vulkan/libvulkan/swapchain.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ static bool IsFencePending(int fd) { } void ReleaseSwapchainImage(VkDevice device, bool shared_present, ANativeWindow* window, int release_fence, Swapchain::Image& image, Loading Loading @@ -330,7 +331,8 @@ void ReleaseSwapchainImage(VkDevice device, } image.dequeue_fence = -1; if (window) { // It's invalid to call cancelBuffer on a shared buffer if (window && !shared_present) { window->cancelBuffer(window, image.buffer.get(), release_fence); } else { if (release_fence >= 0) { Loading Loading @@ -364,9 +366,10 @@ void OrphanSwapchain(VkDevice device, Swapchain* swapchain) { if (swapchain->surface.swapchain_handle != HandleFromSwapchain(swapchain)) return; for (uint32_t i = 0; i < swapchain->num_images; i++) { if (!swapchain->images[i].dequeued) ReleaseSwapchainImage(device, nullptr, -1, swapchain->images[i], true); if (!swapchain->images[i].dequeued) { ReleaseSwapchainImage(device, swapchain->shared, nullptr, -1, swapchain->images[i], true); } } swapchain->surface.swapchain_handle = VK_NULL_HANDLE; swapchain->timing.clear(); Loading Loading @@ -1084,7 +1087,8 @@ static void DestroySwapchainInternal(VkDevice device, } for (uint32_t i = 0; i < swapchain->num_images; i++) { ReleaseSwapchainImage(device, window, -1, swapchain->images[i], false); ReleaseSwapchainImage(device, swapchain->shared, window, -1, swapchain->images[i], false); } if (active) { Loading Loading @@ -1854,7 +1858,8 @@ VkResult QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info) { WorstPresentResult(swapchain_result, VK_SUBOPTIMAL_KHR); } } else { ReleaseSwapchainImage(device, nullptr, fence, img, true); ReleaseSwapchainImage(device, swapchain.shared, nullptr, fence, img, true); swapchain_result = VK_ERROR_OUT_OF_DATE_KHR; } Loading Loading
vulkan/libvulkan/swapchain.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ static bool IsFencePending(int fd) { } void ReleaseSwapchainImage(VkDevice device, bool shared_present, ANativeWindow* window, int release_fence, Swapchain::Image& image, Loading Loading @@ -330,7 +331,8 @@ void ReleaseSwapchainImage(VkDevice device, } image.dequeue_fence = -1; if (window) { // It's invalid to call cancelBuffer on a shared buffer if (window && !shared_present) { window->cancelBuffer(window, image.buffer.get(), release_fence); } else { if (release_fence >= 0) { Loading Loading @@ -364,9 +366,10 @@ void OrphanSwapchain(VkDevice device, Swapchain* swapchain) { if (swapchain->surface.swapchain_handle != HandleFromSwapchain(swapchain)) return; for (uint32_t i = 0; i < swapchain->num_images; i++) { if (!swapchain->images[i].dequeued) ReleaseSwapchainImage(device, nullptr, -1, swapchain->images[i], true); if (!swapchain->images[i].dequeued) { ReleaseSwapchainImage(device, swapchain->shared, nullptr, -1, swapchain->images[i], true); } } swapchain->surface.swapchain_handle = VK_NULL_HANDLE; swapchain->timing.clear(); Loading Loading @@ -1084,7 +1087,8 @@ static void DestroySwapchainInternal(VkDevice device, } for (uint32_t i = 0; i < swapchain->num_images; i++) { ReleaseSwapchainImage(device, window, -1, swapchain->images[i], false); ReleaseSwapchainImage(device, swapchain->shared, window, -1, swapchain->images[i], false); } if (active) { Loading Loading @@ -1854,7 +1858,8 @@ VkResult QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info) { WorstPresentResult(swapchain_result, VK_SUBOPTIMAL_KHR); } } else { ReleaseSwapchainImage(device, nullptr, fence, img, true); ReleaseSwapchainImage(device, swapchain.shared, nullptr, fence, img, true); swapchain_result = VK_ERROR_OUT_OF_DATE_KHR; } Loading