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/texture_cache | |
| 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/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/image_info.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/image_view_info.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/samples_helper.h | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 20 |
4 files changed, 14 insertions, 14 deletions
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 { | |||
| 94 | resources.layers = 1; | 94 | resources.layers = 1; |
| 95 | break; | 95 | break; |
| 96 | default: | 96 | default: |
| 97 | UNREACHABLE_MSG("Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); | 97 | ASSERT_MSG(false, "Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); |
| 98 | break; | 98 | break; |
| 99 | } | 99 | } |
| 100 | if (type != ImageType::Linear) { | 100 | 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 | |||
| 71 | range.extent.layers = config.Depth() * 6; | 71 | range.extent.layers = config.Depth() * 6; |
| 72 | break; | 72 | break; |
| 73 | default: | 73 | default: |
| 74 | UNREACHABLE_MSG("Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); | 74 | ASSERT_MSG(false, "Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); |
| 75 | break; | 75 | break; |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
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 { | |||
| 23 | case 16: | 23 | case 16: |
| 24 | return {2, 2}; | 24 | return {2, 2}; |
| 25 | } | 25 | } |
| 26 | UNREACHABLE_MSG("Invalid number of samples={}", num_samples); | 26 | ASSERT_MSG(false, "Invalid number of samples={}", num_samples); |
| 27 | return {1, 1}; | 27 | return {1, 1}; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| @@ -47,7 +47,7 @@ namespace VideoCommon { | |||
| 47 | case MsaaMode::Msaa4x4: | 47 | case MsaaMode::Msaa4x4: |
| 48 | return 16; | 48 | return 16; |
| 49 | } | 49 | } |
| 50 | UNREACHABLE_MSG("Invalid MSAA mode={}", static_cast<int>(msaa_mode)); | 50 | ASSERT_MSG(false, "Invalid MSAA mode={}", static_cast<int>(msaa_mode)); |
| 51 | return 1; | 51 | return 1; |
| 52 | } | 52 | } |
| 53 | 53 | ||
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<P>::UnregisterImage(ImageId image_id) { | |||
| 1485 | std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { | 1485 | std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { |
| 1486 | const auto page_it = selected_page_table.find(page); | 1486 | const auto page_it = selected_page_table.find(page); |
| 1487 | if (page_it == selected_page_table.end()) { | 1487 | if (page_it == selected_page_table.end()) { |
| 1488 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1488 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1489 | return; | 1489 | return; |
| 1490 | } | 1490 | } |
| 1491 | std::vector<ImageId>& image_ids = page_it->second; | 1491 | std::vector<ImageId>& image_ids = page_it->second; |
| 1492 | const auto vector_it = std::ranges::find(image_ids, image_id); | 1492 | const auto vector_it = std::ranges::find(image_ids, image_id); |
| 1493 | if (vector_it == image_ids.end()) { | 1493 | if (vector_it == image_ids.end()) { |
| 1494 | UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", | 1494 | ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", |
| 1495 | page << PAGE_BITS); | 1495 | page << PAGE_BITS); |
| 1496 | return; | 1496 | return; |
| 1497 | } | 1497 | } |
| 1498 | image_ids.erase(vector_it); | 1498 | image_ids.erase(vector_it); |
| @@ -1504,14 +1504,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { | |||
| 1504 | ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { | 1504 | ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { |
| 1505 | const auto page_it = page_table.find(page); | 1505 | const auto page_it = page_table.find(page); |
| 1506 | if (page_it == page_table.end()) { | 1506 | if (page_it == page_table.end()) { |
| 1507 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1507 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1508 | return; | 1508 | return; |
| 1509 | } | 1509 | } |
| 1510 | std::vector<ImageMapId>& image_map_ids = page_it->second; | 1510 | std::vector<ImageMapId>& image_map_ids = page_it->second; |
| 1511 | const auto vector_it = std::ranges::find(image_map_ids, map_id); | 1511 | const auto vector_it = std::ranges::find(image_map_ids, map_id); |
| 1512 | if (vector_it == image_map_ids.end()) { | 1512 | if (vector_it == image_map_ids.end()) { |
| 1513 | UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", | 1513 | ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", |
| 1514 | page << PAGE_BITS); | 1514 | page << PAGE_BITS); |
| 1515 | return; | 1515 | return; |
| 1516 | } | 1516 | } |
| 1517 | image_map_ids.erase(vector_it); | 1517 | image_map_ids.erase(vector_it); |
| @@ -1532,7 +1532,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { | |||
| 1532 | ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { | 1532 | ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { |
| 1533 | const auto page_it = page_table.find(page); | 1533 | const auto page_it = page_table.find(page); |
| 1534 | if (page_it == page_table.end()) { | 1534 | if (page_it == page_table.end()) { |
| 1535 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1535 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1536 | return; | 1536 | return; |
| 1537 | } | 1537 | } |
| 1538 | std::vector<ImageMapId>& image_map_ids = page_it->second; | 1538 | std::vector<ImageMapId>& image_map_ids = page_it->second; |
| @@ -1616,15 +1616,15 @@ void TextureCache<P>::DeleteImage(ImageId image_id, bool immediate_delete) { | |||
| 1616 | const GPUVAddr gpu_addr = image.gpu_addr; | 1616 | const GPUVAddr gpu_addr = image.gpu_addr; |
| 1617 | const auto alloc_it = image_allocs_table.find(gpu_addr); | 1617 | const auto alloc_it = image_allocs_table.find(gpu_addr); |
| 1618 | if (alloc_it == image_allocs_table.end()) { | 1618 | if (alloc_it == image_allocs_table.end()) { |
| 1619 | UNREACHABLE_MSG("Trying to delete an image alloc that does not exist in address 0x{:x}", | 1619 | ASSERT_MSG(false, "Trying to delete an image alloc that does not exist in address 0x{:x}", |
| 1620 | gpu_addr); | 1620 | gpu_addr); |
| 1621 | return; | 1621 | return; |
| 1622 | } | 1622 | } |
| 1623 | const ImageAllocId alloc_id = alloc_it->second; | 1623 | const ImageAllocId alloc_id = alloc_it->second; |
| 1624 | std::vector<ImageId>& alloc_images = slot_image_allocs[alloc_id].images; | 1624 | std::vector<ImageId>& alloc_images = slot_image_allocs[alloc_id].images; |
| 1625 | const auto alloc_image_it = std::ranges::find(alloc_images, image_id); | 1625 | const auto alloc_image_it = std::ranges::find(alloc_images, image_id); |
| 1626 | if (alloc_image_it == alloc_images.end()) { | 1626 | if (alloc_image_it == alloc_images.end()) { |
| 1627 | UNREACHABLE_MSG("Trying to delete an image that does not exist"); | 1627 | ASSERT_MSG(false, "Trying to delete an image that does not exist"); |
| 1628 | return; | 1628 | return; |
| 1629 | } | 1629 | } |
| 1630 | ASSERT_MSG(False(image.flags & ImageFlagBits::Tracked), "Image was not untracked"); | 1630 | ASSERT_MSG(False(image.flags & ImageFlagBits::Tracked), "Image was not untracked"); |