common: `Common` namespace for the slot vector container

This commit is contained in:
psucien 2024-06-18 14:05:11 +02:00
parent 6f69b32555
commit 723e3cd0f9
5 changed files with 10 additions and 10 deletions

View File

@ -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<u32>::max();
@ -162,11 +162,11 @@ private:
std::vector<u32> free_list;
};
} // namespace VideoCore
} // namespace Common
template <>
struct std::hash<VideoCore::SlotId> {
std::size_t operator()(const VideoCore::SlotId& id) const noexcept {
struct std::hash<Common::SlotId> {
std::size_t operator()(const Common::SlotId& id) const noexcept {
return std::hash<u32>{}(id.index);
}
};

View File

@ -38,7 +38,7 @@ struct AscQueueInfo {
u32* read_addr;
u32 ring_size_dw;
};
static VideoCore::SlotVector<AscQueueInfo> asc_queues{};
static Common::SlotVector<AscQueueInfo> asc_queues{};
static constexpr VAddr tessellation_factors_ring_addr = 0xFF0000000ULL;
static void DumpCommandList(std::span<const u32> cmd_list, const std::string& postfix) {

View File

@ -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,

View File

@ -140,8 +140,8 @@ private:
Vulkan::Scheduler& scheduler;
Vulkan::StreamBuffer staging;
TileManager tile_manager;
SlotVector<Image> slot_images;
SlotVector<ImageView> slot_image_views;
Common::SlotVector<Image> slot_images;
Common::SlotVector<ImageView> slot_image_views;
tsl::robin_map<u64, Sampler> samplers;
tsl::robin_pg_map<u64, std::vector<ImageId>> page_table;
boost::icl::interval_map<VAddr, s32> cached_pages;

View File

@ -8,8 +8,8 @@
namespace VideoCore {
using ImageId = SlotId;
using ImageViewId = SlotId;
using ImageId = Common::SlotId;
using ImageViewId = Common::SlotId;
struct Offset2D {
s32 x;