From ae5be1df34f3300c2e2eacbce6c2b9cdb70ffc30 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 20 Jul 2021 00:26:07 +0000 Subject: [PATCH] Vulkan: ignore errors in shutdown vkWaitForFences. There is nothing we can do when these errors happen except proceeding with the clean shutdown of the Vulkan device by destroying all the fences. Bug: chromium:1230251 Change-Id: I5f14770bf71072616783afec7cf9538c9b103f23 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58398 Commit-Queue: Jiawei Shao Auto-Submit: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Jiawei Shao --- src/dawn_native/vulkan/DeviceVk.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dawn_native/vulkan/DeviceVk.cpp b/src/dawn_native/vulkan/DeviceVk.cpp index 2f7cbad73a..d692caad4c 100644 --- a/src/dawn_native/vulkan/DeviceVk.cpp +++ b/src/dawn_native/vulkan/DeviceVk.cpp @@ -845,11 +845,12 @@ namespace dawn_native { namespace vulkan { INJECT_ERROR_OR_RUN(fn.WaitForFences(mVkDevice, 1, &*fence, true, UINT64_MAX), VK_ERROR_DEVICE_LOST)); } while (result == VK_TIMEOUT); + // Ignore errors from vkWaitForFences: it can be either OOM which we can't do anything + // about (and we need to keep going with the destruction of all fences), or device + // loss, which means the workload on the GPU is no longer accessible and we can + // safely destroy the fence. - // TODO: Handle errors - ASSERT(result == VK_SUCCESS); fn.DestroyFence(mVkDevice, fence, nullptr); - mFencesInFlight.pop(); } return {};