From 723e3cd0f98f2a3e49afeb6e3794365095894c91 Mon Sep 17 00:00:00 2001 From: psucien Date: Tue, 18 Jun 2024 14:05:11 +0200 Subject: [PATCH] common: `Common` namespace for the slot vector container --- src/common/slot_vector.h | 8 ++++---- src/core/libraries/gnmdriver/gnmdriver.cpp | 2 +- src/video_core/texture_cache/image.h | 2 +- src/video_core/texture_cache/texture_cache.h | 4 ++-- src/video_core/texture_cache/types.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/slot_vector.h b/src/common/slot_vector.h index 7f232920..06c057c2 100644 --- a/src/common/slot_vector.h +++ b/src/common/slot_vector.h @@ -12,7 +12,7 @@ #include "common/assert.h" #include "common/types.h" -namespace VideoCore { +namespace Common { struct SlotId { static constexpr u32 INVALID_INDEX = std::numeric_limits::max(); @@ -162,11 +162,11 @@ private: std::vector free_list; }; -} // namespace VideoCore +} // namespace Common template <> -struct std::hash { - std::size_t operator()(const VideoCore::SlotId& id) const noexcept { +struct std::hash { + std::size_t operator()(const Common::SlotId& id) const noexcept { return std::hash{}(id.index); } }; diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index 62dd9985..4ccd06df 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -38,7 +38,7 @@ struct AscQueueInfo { u32* read_addr; u32 ring_size_dw; }; -static VideoCore::SlotVector asc_queues{}; +static Common::SlotVector asc_queues{}; static constexpr VAddr tessellation_factors_ring_addr = 0xFF0000000ULL; static void DumpCommandList(std::span cmd_list, const std::string& postfix) { diff --git a/src/video_core/texture_cache/image.h b/src/video_core/texture_cache/image.h index f54a796f..e1c50b16 100644 --- a/src/video_core/texture_cache/image.h +++ b/src/video_core/texture_cache/image.h @@ -90,7 +90,7 @@ private: vk::Image image{}; }; -constexpr SlotId NULL_IMAGE_ID{0}; +constexpr Common::SlotId NULL_IMAGE_ID{0}; struct Image { explicit Image(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler, diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 1d5aafa2..0ecd9faf 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -140,8 +140,8 @@ private: Vulkan::Scheduler& scheduler; Vulkan::StreamBuffer staging; TileManager tile_manager; - SlotVector slot_images; - SlotVector slot_image_views; + Common::SlotVector slot_images; + Common::SlotVector slot_image_views; tsl::robin_map samplers; tsl::robin_pg_map> page_table; boost::icl::interval_map cached_pages; diff --git a/src/video_core/texture_cache/types.h b/src/video_core/texture_cache/types.h index 335d6d83..fd646665 100644 --- a/src/video_core/texture_cache/types.h +++ b/src/video_core/texture_cache/types.h @@ -8,8 +8,8 @@ namespace VideoCore { -using ImageId = SlotId; -using ImageViewId = SlotId; +using ImageId = Common::SlotId; +using ImageViewId = Common::SlotId; struct Offset2D { s32 x;