mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-01 10:52:26 +00:00
[common] Switch to boost::unordered_flat containers (#4326)
Replaces all instances of ankerl's unordered map/set with boost's `unordered_flat_*` classes. This uses std::hash since boost::hash is actually a lot slower. Also adds an abstraction layer in `Common` so future changes are quicker and easier. Other implementation details: - ankerl provided hash specializations for tuple and pair, so those were ported here - std::erase_if doesn't work on boost, so just used the ADL'd erase_if This should be about equal or superior performance as unordered_dense for everything except iteration. Signed-off-by: crueter <crueter@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <boost/container/static_vector.hpp>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <deque>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_set.h"
|
||||
#include <utility>
|
||||
|
||||
#include "common/alignment.h"
|
||||
@@ -257,7 +257,7 @@ private:
|
||||
std::array<Manager*, NUM_HIGH_PAGES> top_tier{};
|
||||
std::deque<std::array<Manager, MANAGER_POOL_SIZE>> manager_pool;
|
||||
std::deque<Manager*> free_managers;
|
||||
ankerl::unordered_dense::set<u32> cached_pages;
|
||||
::Common::unordered_set<u32> cached_pages;
|
||||
DeviceTracker* device_tracker = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
@@ -88,14 +88,14 @@ protected:
|
||||
|
||||
std::deque<P> channel_storage;
|
||||
std::deque<size_t> free_channel_ids;
|
||||
ankerl::unordered_dense::map<s32, size_t> channel_map;
|
||||
::Common::unordered_map<s32, size_t> channel_map;
|
||||
std::vector<size_t> active_channel_ids;
|
||||
struct AddressSpaceRef {
|
||||
size_t ref_count;
|
||||
size_t storage_id;
|
||||
Tegra::MemoryManager* gpu_memory;
|
||||
};
|
||||
ankerl::unordered_dense::map<size_t, AddressSpaceRef> address_spaces;
|
||||
::Common::unordered_map<size_t, AddressSpaceRef> address_spaces;
|
||||
mutable std::mutex config_mutex;
|
||||
|
||||
virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
|
||||
#include "video_core/dma_pusher.h"
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
void DeclareChannel(std::shared_ptr<ChannelState> new_channel);
|
||||
|
||||
private:
|
||||
ankerl::unordered_dense::map<s32, std::shared_ptr<ChannelState>> channels;
|
||||
::Common::unordered_map<s32, std::shared_ptr<ChannelState>> channels;
|
||||
std::mutex scheduling_guard;
|
||||
};
|
||||
|
||||
|
||||
@@ -3111,7 +3111,7 @@ public:
|
||||
|
||||
void SetHLEReplacementAttributeType(u32 bank, u32 offset, HLEReplacementAttributeType name);
|
||||
|
||||
ankerl::unordered_dense::map<u64, HLEReplacementAttributeType> replace_table;
|
||||
::Common::unordered_map<u64, HLEReplacementAttributeType> replace_table;
|
||||
|
||||
static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size");
|
||||
static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <span>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <bit>
|
||||
#include <numeric>
|
||||
#include "common/assert.h"
|
||||
@@ -924,7 +924,7 @@ public:
|
||||
};
|
||||
|
||||
struct ConverterFactory::ConverterFactoryImpl {
|
||||
ankerl::unordered_dense::map<RenderTargetFormat, std::unique_ptr<Converter>> converters_cache;
|
||||
::Common::unordered_map<RenderTargetFormat, std::unique_ptr<Converter>> converters_cache;
|
||||
};
|
||||
|
||||
ConverterFactory::ConverterFactory() {
|
||||
|
||||
@@ -333,7 +333,7 @@ struct GPU::Impl {
|
||||
std::unique_ptr<Core::Frontend::GraphicsContext> cpu_context;
|
||||
|
||||
Tegra::Control::Scheduler scheduler;
|
||||
ankerl::unordered_dense::map<s32, std::shared_ptr<Tegra::Control::ChannelState>> channels;
|
||||
::Common::unordered_map<s32, std::shared_ptr<Tegra::Control::ChannelState>> channels;
|
||||
Tegra::Control::ChannelState* current_channel;
|
||||
s32 bound_channel{-1};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
@@ -152,7 +152,7 @@ private:
|
||||
mutable std::mutex ring_buffer_mutex;
|
||||
|
||||
// Memory tracking
|
||||
ankerl::unordered_dense::map<uintptr_t, MemoryAllocationEntry> memory_allocations;
|
||||
::Common::unordered_map<uintptr_t, MemoryAllocationEntry> memory_allocations;
|
||||
mutable std::mutex memory_mutex;
|
||||
|
||||
// Statistics
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <queue>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <unordered_map>
|
||||
#include <variant>
|
||||
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
}
|
||||
|
||||
std::mutex m_mutex{};
|
||||
ankerl::unordered_dense::map<s32, FrameDevice> m_frame_devices;
|
||||
::Common::unordered_map<s32, FrameDevice> m_frame_devices;
|
||||
|
||||
static constexpr size_t MAX_PRESENT_QUEUE = 100;
|
||||
static constexpr size_t MAX_DECODE_MAP = 200;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <span>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
@@ -237,8 +237,8 @@ struct MacroEngine {
|
||||
AnyCachedMacro program;
|
||||
u64 hash{};
|
||||
};
|
||||
ankerl::unordered_dense::map<u32, CacheInfo> macro_cache;
|
||||
ankerl::unordered_dense::map<u32, std::vector<u32>> uploaded_macro_code;
|
||||
::Common::unordered_map<u32, CacheInfo> macro_cache;
|
||||
::Common::unordered_map<u32, std::vector<u32>> uploaded_macro_code;
|
||||
bool is_interpreted;
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/assert.h"
|
||||
@@ -350,7 +350,7 @@ private:
|
||||
|
||||
mutable std::recursive_mutex mutex;
|
||||
|
||||
ankerl::unordered_dense::map<u64, std::vector<CachedQuery>> cached_queries;
|
||||
::Common::unordered_map<u64, std::vector<CachedQuery>> cached_queries;
|
||||
|
||||
std::array<CounterStream, VideoCore::NumQueryTypes> streams;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
@@ -155,12 +155,12 @@ protected:
|
||||
const auto in_range2 = [&](const std::pair<u32, QueryLocation>& pair) {
|
||||
return in_range(pair.first);
|
||||
};
|
||||
std::erase_if(contents, in_range2);
|
||||
erase_if(contents, in_range2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using ContentCache = ankerl::unordered_dense::map<u64, ankerl::unordered_dense::map<u32, QueryLocation>>;
|
||||
using ContentCache = ::Common::unordered_map<u64, ::Common::unordered_map<u32, QueryLocation>>;
|
||||
|
||||
void InvalidateQuery(QueryLocation location);
|
||||
bool IsQueryDirty(QueryLocation location);
|
||||
@@ -168,7 +168,7 @@ protected:
|
||||
void RequestGuestHostSync();
|
||||
void UnregisterPending();
|
||||
|
||||
ankerl::unordered_dense::map<u64, ankerl::unordered_dense::map<u32, QueryLocation>> cached_queries;
|
||||
::Common::unordered_map<u64, ::Common::unordered_map<u32, QueryLocation>> cached_queries;
|
||||
std::mutex cache_mutex;
|
||||
|
||||
struct QueryCacheBaseImpl;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <array>
|
||||
#include <span>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "video_core/buffer_cache/buffer_cache_base.h"
|
||||
@@ -242,7 +242,7 @@ private:
|
||||
u32 index_buffer_offset = 0;
|
||||
|
||||
u64 device_access_memory;
|
||||
ankerl::unordered_dense::map<GPUVAddr, OGLTransformFeedback> tfb_objects;
|
||||
::Common::unordered_map<GPUVAddr, OGLTransformFeedback> tfb_objects;
|
||||
};
|
||||
|
||||
struct BufferCacheParams {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/thread_worker.h"
|
||||
@@ -81,8 +81,8 @@ private:
|
||||
GraphicsPipeline* current_pipeline{};
|
||||
|
||||
ShaderContext::ShaderPools main_pools;
|
||||
ankerl::unordered_dense::map<GraphicsPipelineKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
|
||||
ankerl::unordered_dense::map<ComputePipelineKey, std::unique_ptr<ComputePipeline>> compute_cache;
|
||||
::Common::unordered_map<GraphicsPipelineKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
|
||||
::Common::unordered_map<ComputePipelineKey, std::unique_ptr<ComputePipeline>> compute_cache;
|
||||
|
||||
Shader::Profile profile;
|
||||
Shader::HostTranslateInfo host_info;
|
||||
|
||||
@@ -159,7 +159,7 @@ private:
|
||||
UtilShaders util_shaders;
|
||||
FormatConversionPass format_conversion_pass;
|
||||
|
||||
std::array<ankerl::unordered_dense::map<GLenum, FormatProperties>, 3> format_properties;
|
||||
std::array<::Common::unordered_map<GLenum, FormatProperties>, 3> format_properties;
|
||||
bool has_broken_texture_view_formats = false;
|
||||
|
||||
OGLTexture null_image_1d_array;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
@@ -163,8 +163,8 @@ private:
|
||||
GraphicsPipelineCacheKey graphics_key{};
|
||||
GraphicsPipeline* current_pipeline{};
|
||||
|
||||
ankerl::unordered_dense::map<ComputePipelineCacheKey, std::unique_ptr<ComputePipeline>> compute_cache;
|
||||
ankerl::unordered_dense::map<GraphicsPipelineCacheKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
|
||||
::Common::unordered_map<ComputePipelineCacheKey, std::unique_ptr<ComputePipeline>> compute_cache;
|
||||
::Common::unordered_map<GraphicsPipelineCacheKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
|
||||
|
||||
ShaderPools main_pools;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <type_traits>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "video_core/renderer_vulkan/vk_texture_cache.h"
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
sync_values_stash.emplace_back();
|
||||
std::vector<HostSyncValues>* sync_values = &sync_values_stash.back();
|
||||
sync_values->reserve(num_slots_used);
|
||||
ankerl::unordered_dense::map<size_t, std::pair<size_t, size_t>> offsets;
|
||||
::Common::unordered_map<size_t, std::pair<size_t, size_t>> offsets;
|
||||
resolve_buffers.clear();
|
||||
size_t resolve_buffer_index = ObtainBuffer<true>(num_slots_used);
|
||||
resolve_buffers.push_back(resolve_buffer_index);
|
||||
@@ -428,7 +428,7 @@ private:
|
||||
template <bool is_ordered, typename Func>
|
||||
void ApplyBanksWideOp(std::vector<size_t>& queries, Func&& func) {
|
||||
std::conditional_t<is_ordered, std::map<size_t, std::pair<size_t, size_t>>,
|
||||
ankerl::unordered_dense::map<size_t, std::pair<size_t, size_t>>>
|
||||
::Common::unordered_map<size_t, std::pair<size_t, size_t>>>
|
||||
indexer;
|
||||
for (auto q : queries) {
|
||||
auto* query = GetQuery(q);
|
||||
@@ -757,7 +757,7 @@ public:
|
||||
|
||||
void SyncWrites() override {
|
||||
CloseCounter();
|
||||
ankerl::unordered_dense::map<size_t, std::vector<HostSyncValues>> sync_values_stash;
|
||||
::Common::unordered_map<size_t, std::vector<HostSyncValues>> sync_values_stash;
|
||||
for (auto q : pending_sync) {
|
||||
auto* query = GetQuery(q);
|
||||
if (True(query->flags & VideoCommon::QueryFlagBits::IsRewritten)) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
|
||||
#include <boost/container/static_vector.hpp>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
|
||||
#include "common/container_hash.h"
|
||||
#include "video_core/surface.h"
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
private:
|
||||
const Device* device{};
|
||||
ankerl::unordered_dense::map<RenderPassKey, vk::RenderPass> cache;
|
||||
::Common::unordered_map<RenderPassKey, vk::RenderPass> cache;
|
||||
std::mutex mutex;
|
||||
};
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
};
|
||||
|
||||
std::vector<MsaaScratchImage> msaa_scratch_images;
|
||||
ankerl::unordered_dense::map<VkImage, ResolveShadow> resolve_shadows;
|
||||
::Common::unordered_map<VkImage, ResolveShadow> resolve_shadows;
|
||||
std::vector<std::pair<u64, ResolveShadow>> pending_resolve_shadows;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <span>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -148,8 +148,8 @@ private:
|
||||
mutable std::mutex lookup_mutex;
|
||||
std::mutex invalidation_mutex;
|
||||
|
||||
ankerl::unordered_dense::map<u64, std::unique_ptr<Entry>> lookup_cache;
|
||||
ankerl::unordered_dense::map<u64, std::vector<Entry*>> invalidation_cache;
|
||||
::Common::unordered_map<u64, std::unique_ptr<Entry>> lookup_cache;
|
||||
::Common::unordered_map<u64, std::vector<Entry*>> invalidation_cache;
|
||||
std::vector<std::unique_ptr<ShaderInfo>> storage;
|
||||
std::vector<Entry*> marked_for_removal;
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <type_traits>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
@@ -79,10 +79,10 @@ protected:
|
||||
GPUVAddr program_base{};
|
||||
|
||||
std::vector<u64> code;
|
||||
ankerl::unordered_dense::map<u32, Shader::TextureType> texture_types;
|
||||
ankerl::unordered_dense::map<u32, Shader::TexturePixelFormat> texture_pixel_formats;
|
||||
ankerl::unordered_dense::map<u64, u32> cbuf_values;
|
||||
ankerl::unordered_dense::map<u64, Shader::ReplaceConstant> cbuf_replacements;
|
||||
::Common::unordered_map<u32, Shader::TextureType> texture_types;
|
||||
::Common::unordered_map<u32, Shader::TexturePixelFormat> texture_pixel_formats;
|
||||
::Common::unordered_map<u64, u32> cbuf_values;
|
||||
::Common::unordered_map<u64, Shader::ReplaceConstant> cbuf_replacements;
|
||||
|
||||
u32 local_memory_size{};
|
||||
u32 texture_bound{};
|
||||
@@ -201,10 +201,10 @@ public:
|
||||
|
||||
private:
|
||||
std::vector<u64> code;
|
||||
ankerl::unordered_dense::map<u32, Shader::TextureType> texture_types;
|
||||
ankerl::unordered_dense::map<u32, Shader::TexturePixelFormat> texture_pixel_formats;
|
||||
ankerl::unordered_dense::map<u64, u32> cbuf_values;
|
||||
ankerl::unordered_dense::map<u64, Shader::ReplaceConstant> cbuf_replacements;
|
||||
::Common::unordered_map<u32, Shader::TextureType> texture_types;
|
||||
::Common::unordered_map<u32, Shader::TexturePixelFormat> texture_pixel_formats;
|
||||
::Common::unordered_map<u64, u32> cbuf_values;
|
||||
::Common::unordered_map<u64, Shader::ReplaceConstant> cbuf_replacements;
|
||||
std::array<u32, 3> workgroup_size{};
|
||||
u32 local_memory_size{};
|
||||
u32 shared_memory_size{};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <bit>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
#include "common/alignment.h"
|
||||
@@ -2190,7 +2190,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) {
|
||||
image.flags &= ~ImageFlagBits::BadOverlap;
|
||||
lru_cache.Free(image.lru_index);
|
||||
const auto& clear_page_table =
|
||||
[image_id](u64 page, ankerl::unordered_dense::map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>& selected_page_table) {
|
||||
[image_id](u64 page, ::Common::unordered_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()) {
|
||||
ASSERT_MSG(false, "Unregistering unregistered page={:#x}", page << YUZU_PAGEBITS);
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <type_traits>
|
||||
// TODO: find out which don't require stable iters
|
||||
#include <unordered_map>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include "common/container/unordered_set.h"
|
||||
#include <vector>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include <boost/container/static_vector.hpp>
|
||||
@@ -68,7 +69,7 @@ struct AsyncDecodeContext {
|
||||
std::atomic_bool complete;
|
||||
};
|
||||
|
||||
using TextureCacheGPUMap = ankerl::unordered_dense::map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>;
|
||||
using TextureCacheGPUMap = ::Common::unordered_map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>;
|
||||
|
||||
class TextureCacheChannelInfo : public ChannelInfo {
|
||||
public:
|
||||
@@ -86,8 +87,8 @@ public:
|
||||
std::unordered_map<TICEntry, ImageViewId> image_views;
|
||||
std::unordered_map<TSCEntry, SamplerId> samplers;
|
||||
|
||||
ankerl::unordered_dense::map<u32, SamplerId> sampler_ids;
|
||||
ankerl::unordered_dense::map<u32, ImageViewId> image_view_ids;
|
||||
::Common::unordered_map<u32, SamplerId> sampler_ids;
|
||||
::Common::unordered_map<u32, ImageViewId> image_view_ids;
|
||||
|
||||
TextureCacheGPUMap* gpu_page_table = nullptr;
|
||||
TextureCacheGPUMap* sparse_page_table = nullptr;
|
||||
@@ -441,9 +442,9 @@ private:
|
||||
FramebufferId last_framebuffer_id{};
|
||||
u64 last_framebuffer_serial = 0;
|
||||
|
||||
ankerl::unordered_dense::map<RenderTargets, FramebufferId> framebuffers;
|
||||
ankerl::unordered_dense::map<u64, std::vector<ImageMapId>, Common::IdentityHash<u64>> page_table;
|
||||
ankerl::unordered_dense::map<ImageId, boost::container::small_vector<ImageViewId, 16>> sparse_views;
|
||||
::Common::unordered_map<RenderTargets, FramebufferId> framebuffers;
|
||||
::Common::unordered_map<u64, std::vector<ImageMapId>, Common::IdentityHash<u64>> page_table;
|
||||
::Common::unordered_map<ImageId, boost::container::small_vector<ImageViewId, 16>> sparse_views;
|
||||
|
||||
DAddr virtual_invalid_space{};
|
||||
|
||||
@@ -499,7 +500,7 @@ private:
|
||||
DelayedDestructionRing<ImageView, TICKS_TO_DESTROY> sentenced_image_view;
|
||||
DelayedDestructionRing<Framebuffer, TICKS_TO_DESTROY> sentenced_framebuffers;
|
||||
|
||||
ankerl::unordered_dense::map<GPUVAddr, ImageAllocId> image_allocs_table;
|
||||
::Common::unordered_map<GPUVAddr, ImageAllocId> image_allocs_table;
|
||||
|
||||
Common::ScratchBuffer<u8> swizzle_data_buffer;
|
||||
Common::ScratchBuffer<u8> unswizzle_data_buffer;
|
||||
@@ -516,17 +517,17 @@ private:
|
||||
|
||||
// Join caching
|
||||
boost::container::small_vector<ImageId, 4> join_overlap_ids;
|
||||
ankerl::unordered_dense::set<ImageId> join_overlaps_found;
|
||||
::Common::unordered_set<ImageId> join_overlaps_found;
|
||||
boost::container::small_vector<ImageId, 4> join_left_aliased_ids;
|
||||
boost::container::small_vector<ImageId, 4> join_right_aliased_ids;
|
||||
ankerl::unordered_dense::set<ImageId> join_ignore_textures;
|
||||
::Common::unordered_set<ImageId> join_ignore_textures;
|
||||
boost::container::small_vector<ImageId, 4> join_bad_overlap_ids;
|
||||
struct JoinCopy {
|
||||
bool is_alias;
|
||||
ImageId id;
|
||||
};
|
||||
boost::container::small_vector<JoinCopy, 4> join_copies_to_do;
|
||||
ankerl::unordered_dense::map<ImageId, size_t> join_alias_indices;
|
||||
::Common::unordered_map<ImageId, size_t> join_alias_indices;
|
||||
};
|
||||
|
||||
} // namespace VideoCommon
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
#include <fstream>
|
||||
#include <optional>
|
||||
#include <thread>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include "common/container/unordered_set.h"
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -157,7 +158,7 @@ VkFormatFeatureFlags GetFormatFeatures(VkFormatProperties properties, FormatType
|
||||
}
|
||||
}
|
||||
|
||||
ankerl::unordered_dense::map<VkFormat, VkFormatProperties> GetFormatProperties(vk::PhysicalDevice physical) {
|
||||
::Common::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(vk::PhysicalDevice physical) {
|
||||
static constexpr std::array formats{
|
||||
VK_FORMAT_A1R5G5B5_UNORM_PACK16,
|
||||
VK_FORMAT_A2B10G10R10_SINT_PACK32,
|
||||
@@ -309,7 +310,7 @@ ankerl::unordered_dense::map<VkFormat, VkFormatProperties> GetFormatProperties(v
|
||||
VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
|
||||
VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
|
||||
};
|
||||
ankerl::unordered_dense::map<VkFormat, VkFormatProperties> format_properties;
|
||||
::Common::unordered_map<VkFormat, VkFormatProperties> format_properties;
|
||||
for (const auto format : formats) {
|
||||
format_properties.emplace(format, physical.GetFormatProperties(format));
|
||||
}
|
||||
@@ -317,7 +318,7 @@ ankerl::unordered_dense::map<VkFormat, VkFormatProperties> GetFormatProperties(v
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__) && defined(ARCHITECTURE_arm64)
|
||||
void OverrideBcnFormats(ankerl::unordered_dense::map<VkFormat, VkFormatProperties>& format_properties) {
|
||||
void OverrideBcnFormats(::Common::unordered_map<VkFormat, VkFormatProperties>& format_properties) {
|
||||
// These properties are extracted from Adreno driver 512.687.0
|
||||
constexpr VkFormatFeatureFlags tiling_features{VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
|
||||
VK_FORMAT_FEATURE_BLIT_SRC_BIT |
|
||||
@@ -1676,7 +1677,7 @@ void Device::CollectToolingInfo() {
|
||||
std::vector<VkDeviceQueueCreateInfo> Device::GetDeviceQueueCreateInfos() const {
|
||||
static constexpr float QUEUE_PRIORITY = 1.0f;
|
||||
|
||||
ankerl::unordered_dense::set<u32> unique_queue_families{graphics_family, present_family};
|
||||
::Common::unordered_set<u32> unique_queue_families{graphics_family, present_family};
|
||||
std::vector<VkDeviceQueueCreateInfo> queue_cis;
|
||||
queue_cis.reserve(unique_queue_families.size());
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "common/container/unordered_map.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
@@ -1241,7 +1241,7 @@ private:
|
||||
std::vector<size_t> valid_heap_memory; ///< Heaps used.
|
||||
|
||||
/// Format properties dictionary.
|
||||
ankerl::unordered_dense::map<VkFormat, VkFormatProperties> format_properties;
|
||||
::Common::unordered_map<VkFormat, VkFormatProperties> format_properties;
|
||||
|
||||
/// Nsight Aftermath GPU crash tracker
|
||||
std::unique_ptr<NsightAftermathTracker> nsight_aftermath_tracker;
|
||||
|
||||
Reference in New Issue
Block a user