Browse Source

[video_core] replace std::map/unordered_map/unordered_set with ankerl::unordered_dense:: equivalents

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/350/head
lizzie 4 months ago
committed by crueter
parent
commit
9a7e14ae84
  1. 4
      src/video_core/texture_cache/texture_cache.h
  2. 7
      src/video_core/texture_cache/texture_cache_base.h

4
src/video_core/texture_cache/texture_cache.h

@ -6,8 +6,8 @@
#pragma once
#include <unordered_set>
#include <boost/container/small_vector.hpp>
#include <ankerl/unordered_dense.h>
#include "common/alignment.h"
#include "common/settings.h"
@ -2033,7 +2033,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) {
lru_cache.Free(image.lru_index);
const auto& clear_page_table =
[image_id](u64 page,
std::unordered_map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>&
ankerl::unordered_dense::map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>&
selected_page_table) {
const auto page_it = selected_page_table.find(page);
if (page_it == selected_page_table.end()) {

7
src/video_core/texture_cache/texture_cache_base.h

@ -16,6 +16,7 @@
#include <unordered_set>
#include <vector>
#include <boost/container/small_vector.hpp>
#include <ankerl/unordered_dense.h>
#include <queue>
#include "common/common_types.h"
@ -66,7 +67,7 @@ struct AsyncDecodeContext {
std::atomic_bool complete;
};
using TextureCacheGPUMap = std::unordered_map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>;
using TextureCacheGPUMap = ankerl::unordered_dense::map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>;
class TextureCacheChannelInfo : public ChannelInfo {
public:
@ -85,8 +86,8 @@ public:
std::vector<SamplerId> compute_sampler_ids;
std::vector<ImageViewId> compute_image_view_ids;
std::unordered_map<TICEntry, ImageViewId> image_views;
std::unordered_map<TSCEntry, SamplerId> samplers;
ankerl::unordered_dense::map<TICEntry, ImageViewId> image_views;
ankerl::unordered_dense::map<TSCEntry, SamplerId> samplers;
TextureCacheGPUMap* gpu_page_table;
TextureCacheGPUMap* sparse_page_table;

Loading…
Cancel
Save