early-access version 4033

This commit is contained in:
pineappleEA 2023-12-24 18:21:46 +01:00
parent 1eccf67b1c
commit b5f118f628
3 changed files with 13 additions and 8 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 4032. This is the source code for early-access 4033.
## Legal Notice ## Legal Notice

View File

@ -1084,6 +1084,7 @@ ImageViewId TextureCache<P>::FindImageView(const TICEntry& config) {
ImageViewId& image_view_id = pair->second; ImageViewId& image_view_id = pair->second;
if (is_new) { if (is_new) {
image_view_id = CreateImageView(config); image_view_id = CreateImageView(config);
channel_state->image_views_inv[image_view_id] = config;
} }
return image_view_id; return image_view_id;
} }
@ -2218,14 +2219,17 @@ template <class P>
void TextureCache<P>::RemoveImageViewReferences(std::span<const ImageViewId> removed_views) { void TextureCache<P>::RemoveImageViewReferences(std::span<const ImageViewId> removed_views) {
for (size_t c : active_channel_ids) { for (size_t c : active_channel_ids) {
auto& channel_info = channel_storage[c]; auto& channel_info = channel_storage[c];
auto it = channel_info.image_views.begin(); for (auto image_view_id : removed_views) {
while (it != channel_info.image_views.end()) { auto it_v = channel_info.image_views_inv.find(image_view_id);
const auto found = std::ranges::find(removed_views, it->second); if (it_v == channel_info.image_views_inv.end()) {
if (found != removed_views.end()) { continue;
it = channel_info.image_views.erase(it);
} else {
++it;
} }
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);
} }
} }
} }

View File

@ -81,6 +81,7 @@ public:
std::vector<ImageViewId> compute_image_view_ids; std::vector<ImageViewId> compute_image_view_ids;
std::unordered_map<TICEntry, ImageViewId> image_views; std::unordered_map<TICEntry, ImageViewId> image_views;
std::unordered_map<ImageViewId, TICEntry> image_views_inv;
std::unordered_map<TSCEntry, SamplerId> samplers; std::unordered_map<TSCEntry, SamplerId> samplers;
TextureCacheGPUMap* gpu_page_table; TextureCacheGPUMap* gpu_page_table;