From b5f118f628506ad01649dedfc10ac8b9cd5791ca Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 24 Dec 2023 18:21:46 +0100 Subject: [PATCH] early-access version 4033 --- README.md | 2 +- src/video_core/texture_cache/texture_cache.h | 18 +++++++++++------- .../texture_cache/texture_cache_base.h | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2e622b8ab..69f290147 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4032. +This is the source code for early-access 4033. ## Legal Notice diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 00c8b8e64..810fa9a56 100755 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1084,6 +1084,7 @@ ImageViewId TextureCache

::FindImageView(const TICEntry& config) { ImageViewId& image_view_id = pair->second; if (is_new) { image_view_id = CreateImageView(config); + channel_state->image_views_inv[image_view_id] = config; } return image_view_id; } @@ -2218,14 +2219,17 @@ template void TextureCache

::RemoveImageViewReferences(std::span removed_views) { for (size_t c : active_channel_ids) { auto& channel_info = channel_storage[c]; - auto it = channel_info.image_views.begin(); - while (it != channel_info.image_views.end()) { - const auto found = std::ranges::find(removed_views, it->second); - if (found != removed_views.end()) { - it = channel_info.image_views.erase(it); - } else { - ++it; + for (auto image_view_id : removed_views) { + auto it_v = channel_info.image_views_inv.find(image_view_id); + if (it_v == channel_info.image_views_inv.end()) { + continue; } + auto it = channel_info.image_views.find(it_v->second); + channel_info.image_views_inv.erase(it_v); + if (it == channel_info.image_views.end()) { + continue; + } + channel_info.image_views.erase(it); } } } diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 534fc45df..810931e4d 100755 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -81,6 +81,7 @@ public: std::vector compute_image_view_ids; std::unordered_map image_views; + std::unordered_map image_views_inv; std::unordered_map samplers; TextureCacheGPUMap* gpu_page_table;