[fuchsia] Add fatal error for Vulkan failure (flutter/engine#46831)

This CL changes vkWaitForFences to cause a FATAL failure as we can't
recover from these errors.

Bug: b/297198565
This commit is contained in:
Emircan Uysaler 2023-10-12 17:11:14 -04:00 committed by GitHub
parent 5c9deddce2
commit 218a4e9870
2 changed files with 14 additions and 10 deletions

View File

@ -508,7 +508,7 @@ void VulkanSurface::Reset() {
VkFence fence = command_buffer_fence_;
if (command_buffer_) {
VK_CALL_LOG_ERROR(vulkan_provider_.vk().WaitForFences(
VK_CALL_LOG_FATAL(vulkan_provider_.vk().WaitForFences(
vulkan_provider_.vk_device(), 1, &fence, VK_TRUE, UINT64_MAX));
command_buffer_.reset();
}

View File

@ -26,15 +26,19 @@
#include <vulkan/vulkan.h>
#define VK_CALL_LOG_ERROR(expression) \
({ \
__typeof__(expression) _rc = (expression); \
if (_rc != VK_SUCCESS) { \
FML_LOG(INFO) << "Vulkan call '" << #expression \
<< "' failed with error " \
<< vulkan::VulkanResultToString(_rc); \
} \
_rc; \
#define VK_CALL_LOG_ERROR(expression) VK_CALL_LOG(expression, ERROR)
#define VK_CALL_LOG_FATAL(expression) VK_CALL_LOG(expression, FATAL)
#define VK_CALL_LOG(expression, severity) \
({ \
__typeof__(expression) _rc = (expression); \
if (_rc != VK_SUCCESS) { \
FML_LOG(severity) << "Vulkan call '" << #expression \
<< "' failed with error " \
<< vulkan::VulkanResultToString(_rc); \
} \
_rc; \
})
namespace vulkan {