From 084d7d6b014443be7625fb9d8f1ddd309a22f6f4 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 7 Jun 2022 17:02:29 -0400 Subject: common: Change semantics of UNREACHABLE to unconditionally crash --- src/video_core/vulkan_common/vulkan_device.cpp | 14 ++++++++------ src/video_core/vulkan_common/vulkan_memory_allocator.cpp | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/video_core/vulkan_common') diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index b3a77e07f..11ce865a7 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -738,9 +738,10 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags // The wanted format is not supported by hardware, search for alternatives const VkFormat* alternatives = GetFormatAlternatives(wanted_format); if (alternatives == nullptr) { - UNREACHABLE_MSG("Format={} with usage={} and type={} has no defined alternatives and host " - "hardware does not support it", - wanted_format, wanted_usage, format_type); + ASSERT_MSG(false, + "Format={} with usage={} and type={} has no defined alternatives and host " + "hardware does not support it", + wanted_format, wanted_usage, format_type); return wanted_format; } @@ -756,9 +757,10 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags } // No alternatives found, panic - UNREACHABLE_MSG("Format={} with usage={} and type={} is not supported by the host hardware and " - "doesn't support any of the alternatives", - wanted_format, wanted_usage, format_type); + ASSERT_MSG(false, + "Format={} with usage={} and type={} is not supported by the host hardware and " + "doesn't support any of the alternatives", + wanted_format, wanted_usage, format_type); return wanted_format; } diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index caae6dfdc..6442898bd 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -49,7 +49,7 @@ struct Range { return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; } - UNREACHABLE_MSG("Invalid memory usage={}", usage); + ASSERT_MSG(false, "Invalid memory usage={}", usage); return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; } @@ -325,7 +325,7 @@ VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask, // Remove device local, if it's not supported by the requested resource return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); } - UNREACHABLE_MSG("No compatible memory types found"); + ASSERT_MSG(false, "No compatible memory types found"); return 0; } @@ -349,7 +349,7 @@ bool IsHostVisible(MemoryUsage usage) noexcept { case MemoryUsage::Download: return true; } - UNREACHABLE_MSG("Invalid memory usage={}", usage); + ASSERT_MSG(false, "Invalid memory usage={}", usage); return false; } -- cgit v1.2.3