[TEST] Adjusments on deferred destruction implementation

This commit is contained in:
CamilleLaVey
2026-07-28 16:07:59 -04:00
parent e755504ed8
commit 424eb62cdb
6 changed files with 18 additions and 12 deletions
@@ -9,6 +9,7 @@
#include <algorithm>
#include <array>
#include <bit>
#include <deque>
#include <functional>
#include <memory>
#include <mutex>
+7 -2
View File
@@ -4,9 +4,11 @@
#pragma once
#include <cstddef>
#include <deque>
#include <utility>
#include <boost/container/deque.hpp>
#include <boost/container/options.hpp>
#include "common/common_types.h"
namespace VideoCommon {
@@ -45,7 +47,10 @@ private:
u64 sync_point;
};
std::deque<Entry> entries;
using EntryDequeOptions =
boost::container::deque_options<boost::container::block_size<8u>>::type;
boost::container::deque<Entry, void, EntryDequeOptions> entries;
};
} // namespace VideoCommon
@@ -18,10 +18,10 @@ namespace Vulkan {
UpdateDescriptorQueue::UpdateDescriptorQueue(const Device& device_, size_t frame_payload_size_)
: device{device_}, frame_payload_size{frame_payload_size_},
payload{std::make_unique<DescriptorUpdateEntry[]>(frame_payload_size_ * FRAMES_IN_FLIGHT)}
payload(frame_payload_size_ * FRAMES_IN_FLIGHT)
{
payload_start = payload.get();
payload_cursor = payload.get();
payload_start = payload.data();
payload_cursor = payload.data();
}
UpdateDescriptorQueue::~UpdateDescriptorQueue() = default;
@@ -30,7 +30,7 @@ void UpdateDescriptorQueue::TickFrame() {
if (++frame_index >= FRAMES_IN_FLIGHT) {
frame_index = 0;
}
payload_start = payload.get() + frame_index * frame_payload_size;
payload_start = payload.data() + frame_index * frame_payload_size;
payload_cursor = payload_start;
}
@@ -6,8 +6,8 @@
#pragma once
#include <memory>
#include <variant>
#include <boost/container/small_vector.hpp>
#include "video_core/vulkan_common/vulkan_wrapper.h"
namespace Vulkan {
@@ -80,7 +80,7 @@ private:
DescriptorUpdateEntry* payload_cursor = nullptr;
DescriptorUpdateEntry* payload_start = nullptr;
const DescriptorUpdateEntry* upload_start = nullptr;
std::unique_ptr<DescriptorUpdateEntry[]> payload;
boost::container::small_vector<DescriptorUpdateEntry, 0> payload;
};
// TODO: should these be separate classes instead?
+2 -2
View File
@@ -107,9 +107,9 @@ void TextureCache<P>::QueueEvictionDownload(Image& image) {
pending_eviction_downloads.push_back(PendingEvictionDownload{
.staging = staging,
.gpu_memory = gpu_memory,
.gpu_addr = image.gpu_addr,
.info = image.info,
.copies = std::move(copies),
.info = image.info,
.gpu_addr = image.gpu_addr,
.sync_point = runtime.CurrentSyncPoint(),
});
}
@@ -513,9 +513,9 @@ private:
struct PendingEvictionDownload {
AsyncBuffer staging;
Tegra::MemoryManager* gpu_memory;
GPUVAddr gpu_addr;
VideoCommon::ImageInfo info;
boost::container::small_vector<VideoCommon::BufferImageCopy, 16> copies;
VideoCommon::ImageInfo info;
GPUVAddr gpu_addr;
u64 sync_point;
};
std::deque<PendingEvictionDownload> pending_eviction_downloads;