diff options
| author | 2022-06-07 17:02:29 -0400 | |
|---|---|---|
| committer | 2022-06-13 20:09:00 -0400 | |
| commit | 084d7d6b014443be7625fb9d8f1ddd309a22f6f4 (patch) | |
| tree | ea48c7b1d22a0b282846ba28a9b62c988e38bd29 /src/video_core/vulkan_common | |
| parent | Merge pull request #8458 from lat9nq/no-constexpr-flow-block (diff) | |
| download | yuzu-084d7d6b014443be7625fb9d8f1ddd309a22f6f4.tar.gz yuzu-084d7d6b014443be7625fb9d8f1ddd309a22f6f4.tar.xz yuzu-084d7d6b014443be7625fb9d8f1ddd309a22f6f4.zip | |
common: Change semantics of UNREACHABLE to unconditionally crash
Diffstat (limited to 'src/video_core/vulkan_common')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_memory_allocator.cpp | 6 |
2 files changed, 11 insertions, 9 deletions
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 | |||
| 738 | // The wanted format is not supported by hardware, search for alternatives | 738 | // The wanted format is not supported by hardware, search for alternatives |
| 739 | const VkFormat* alternatives = GetFormatAlternatives(wanted_format); | 739 | const VkFormat* alternatives = GetFormatAlternatives(wanted_format); |
| 740 | if (alternatives == nullptr) { | 740 | if (alternatives == nullptr) { |
| 741 | UNREACHABLE_MSG("Format={} with usage={} and type={} has no defined alternatives and host " | 741 | ASSERT_MSG(false, |
| 742 | "hardware does not support it", | 742 | "Format={} with usage={} and type={} has no defined alternatives and host " |
| 743 | wanted_format, wanted_usage, format_type); | 743 | "hardware does not support it", |
| 744 | wanted_format, wanted_usage, format_type); | ||
| 744 | return wanted_format; | 745 | return wanted_format; |
| 745 | } | 746 | } |
| 746 | 747 | ||
| @@ -756,9 +757,10 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags | |||
| 756 | } | 757 | } |
| 757 | 758 | ||
| 758 | // No alternatives found, panic | 759 | // No alternatives found, panic |
| 759 | UNREACHABLE_MSG("Format={} with usage={} and type={} is not supported by the host hardware and " | 760 | ASSERT_MSG(false, |
| 760 | "doesn't support any of the alternatives", | 761 | "Format={} with usage={} and type={} is not supported by the host hardware and " |
| 761 | wanted_format, wanted_usage, format_type); | 762 | "doesn't support any of the alternatives", |
| 763 | wanted_format, wanted_usage, format_type); | ||
| 762 | return wanted_format; | 764 | return wanted_format; |
| 763 | } | 765 | } |
| 764 | 766 | ||
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 { | |||
| 49 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | | 49 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | |
| 50 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; | 50 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; |
| 51 | } | 51 | } |
| 52 | UNREACHABLE_MSG("Invalid memory usage={}", usage); | 52 | ASSERT_MSG(false, "Invalid memory usage={}", usage); |
| 53 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; | 53 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| @@ -325,7 +325,7 @@ VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask, | |||
| 325 | // Remove device local, if it's not supported by the requested resource | 325 | // Remove device local, if it's not supported by the requested resource |
| 326 | return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); | 326 | return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 327 | } | 327 | } |
| 328 | UNREACHABLE_MSG("No compatible memory types found"); | 328 | ASSERT_MSG(false, "No compatible memory types found"); |
| 329 | return 0; | 329 | return 0; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| @@ -349,7 +349,7 @@ bool IsHostVisible(MemoryUsage usage) noexcept { | |||
| 349 | case MemoryUsage::Download: | 349 | case MemoryUsage::Download: |
| 350 | return true; | 350 | return true; |
| 351 | } | 351 | } |
| 352 | UNREACHABLE_MSG("Invalid memory usage={}", usage); | 352 | ASSERT_MSG(false, "Invalid memory usage={}", usage); |
| 353 | return false; | 353 | return false; |
| 354 | } | 354 | } |
| 355 | 355 | ||