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/texture_cache/image_info.cpp | 2 +- src/video_core/texture_cache/image_view_info.cpp | 2 +- src/video_core/texture_cache/samples_helper.h | 4 ++-- src/video_core/texture_cache/texture_cache.h | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/video_core/texture_cache') diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index 802939f6c..6c073ee57 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -94,7 +94,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { resources.layers = 1; break; default: - UNREACHABLE_MSG("Invalid texture_type={}", static_cast(config.texture_type.Value())); + ASSERT_MSG(false, "Invalid texture_type={}", static_cast(config.texture_type.Value())); break; } if (type != ImageType::Linear) { diff --git a/src/video_core/texture_cache/image_view_info.cpp b/src/video_core/texture_cache/image_view_info.cpp index 0cee5e45f..f47885147 100644 --- a/src/video_core/texture_cache/image_view_info.cpp +++ b/src/video_core/texture_cache/image_view_info.cpp @@ -71,7 +71,7 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept range.extent.layers = config.Depth() * 6; break; default: - UNREACHABLE_MSG("Invalid texture_type={}", static_cast(config.texture_type.Value())); + ASSERT_MSG(false, "Invalid texture_type={}", static_cast(config.texture_type.Value())); break; } } diff --git a/src/video_core/texture_cache/samples_helper.h b/src/video_core/texture_cache/samples_helper.h index 91fec60bd..d552bccf0 100644 --- a/src/video_core/texture_cache/samples_helper.h +++ b/src/video_core/texture_cache/samples_helper.h @@ -23,7 +23,7 @@ namespace VideoCommon { case 16: return {2, 2}; } - UNREACHABLE_MSG("Invalid number of samples={}", num_samples); + ASSERT_MSG(false, "Invalid number of samples={}", num_samples); return {1, 1}; } @@ -47,7 +47,7 @@ namespace VideoCommon { case MsaaMode::Msaa4x4: return 16; } - UNREACHABLE_MSG("Invalid MSAA mode={}", static_cast(msaa_mode)); + ASSERT_MSG(false, "Invalid MSAA mode={}", static_cast(msaa_mode)); return 1; } diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 6622d7818..cf3ca06a6 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1485,14 +1485,14 @@ void TextureCache

::UnregisterImage(ImageId image_id) { std::unordered_map, IdentityHash>& selected_page_table) { const auto page_it = selected_page_table.find(page); if (page_it == selected_page_table.end()) { - UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); return; } std::vector& image_ids = page_it->second; const auto vector_it = std::ranges::find(image_ids, image_id); if (vector_it == image_ids.end()) { - UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", - page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", + page << PAGE_BITS); return; } image_ids.erase(vector_it); @@ -1504,14 +1504,14 @@ void TextureCache

::UnregisterImage(ImageId image_id) { ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { const auto page_it = page_table.find(page); if (page_it == page_table.end()) { - UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); return; } std::vector& image_map_ids = page_it->second; const auto vector_it = std::ranges::find(image_map_ids, map_id); if (vector_it == image_map_ids.end()) { - UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", - page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", + page << PAGE_BITS); return; } image_map_ids.erase(vector_it); @@ -1532,7 +1532,7 @@ void TextureCache

::UnregisterImage(ImageId image_id) { ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { const auto page_it = page_table.find(page); if (page_it == page_table.end()) { - UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); return; } std::vector& image_map_ids = page_it->second; @@ -1616,15 +1616,15 @@ void TextureCache

::DeleteImage(ImageId image_id, bool immediate_delete) { const GPUVAddr gpu_addr = image.gpu_addr; const auto alloc_it = image_allocs_table.find(gpu_addr); if (alloc_it == image_allocs_table.end()) { - UNREACHABLE_MSG("Trying to delete an image alloc that does not exist in address 0x{:x}", - gpu_addr); + ASSERT_MSG(false, "Trying to delete an image alloc that does not exist in address 0x{:x}", + gpu_addr); return; } const ImageAllocId alloc_id = alloc_it->second; std::vector& alloc_images = slot_image_allocs[alloc_id].images; const auto alloc_image_it = std::ranges::find(alloc_images, image_id); if (alloc_image_it == alloc_images.end()) { - UNREACHABLE_MSG("Trying to delete an image that does not exist"); + ASSERT_MSG(false, "Trying to delete an image that does not exist"); return; } ASSERT_MSG(False(image.flags & ImageFlagBits::Tracked), "Image was not untracked"); -- cgit v1.2.3