From a8093c2a3cf98ccccabeb1d6a2c1ccc5e191557f Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 10 Feb 2026 03:34:07 +0100 Subject: [*] change all std::unordered_map and std::unordered_set into ankerl::unordered_dense::map/set variants (#3442) mainly doing this to reduce memory footprint; we all know how nice ankerl::unordered_dense is in theory 4x faster - in practice these maps arent that "hot" anyways so not likely to have much perf gained i just want to reduce mem fragmentation to ease my porting process, plus it helps other platforms as well (ahem weak Mediatek devices) :) Signed-off-by: lizzie Co-authored-by: Caio Oliveira Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3442 Reviewed-by: DraVee Reviewed-by: CamilleLaVey Co-authored-by: lizzie Co-committed-by: lizzie --- src/video_core/texture_cache/texture_cache.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/video_core/texture_cache/texture_cache.h') diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 2564a67780..0ed65e29e9 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "common/alignment.h" @@ -1989,8 +1989,8 @@ SamplerId TextureCache

::FindSampler(const TSCEntry& config) { } const auto [pair, is_new] = channel_state->samplers.try_emplace(config); if (is_new) { - EnforceSamplerBudget(); pair->second = slot_samplers.insert(runtime, config); + EnforceSamplerBudget(); } return pair->second; } @@ -2035,7 +2035,7 @@ void TextureCache

::TrimInactiveSamplers(size_t budget) { } set.insert(id); }; - std::unordered_set active; + ankerl::unordered_dense::set active; active.reserve(channel_state->graphics_sampler_ids.size() + channel_state->compute_sampler_ids.size()); for (const SamplerId id : channel_state->graphics_sampler_ids) { @@ -2363,9 +2363,7 @@ void TextureCache

::UnregisterImage(ImageId image_id) { image.flags &= ~ImageFlagBits::BadOverlap; lru_cache.Free(image.lru_index); const auto& clear_page_table = - [image_id](u64 page, - std::unordered_map, Common::IdentityHash>& - selected_page_table) { + [image_id](u64 page, ankerl::unordered_dense::map, Common::IdentityHash>& selected_page_table) { const auto page_it = selected_page_table.find(page); if (page_it == selected_page_table.end()) { ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS); -- cgit v1.2.3