mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[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:
parent
5c9deddce2
commit
218a4e9870
@ -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();
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user