aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.hh
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-03-30 22:47:12 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-03-30 22:47:12 +1100
commit108801fe96d855c5ccf532639a6db8ff0065310e (patch)
tree24f551fbffad9ec4fd842f56dd530d65a1150723 /src/queue_context.hh
parent7b17b60786d00c592f0ef18c8481148143baacbd (diff)
Move timestamp pool reacquisition to an asynchronous worker queue, fix device_context race during destructor
Diffstat (limited to 'src/queue_context.hh')
-rw-r--r--src/queue_context.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/queue_context.hh b/src/queue_context.hh
index a52e718..873a85a 100644
--- a/src/queue_context.hh
+++ b/src/queue_context.hh
@@ -20,6 +20,7 @@ class QueueContext final : public Context {
// we give up tracking them. This is neccessary for queues which do not
// present anything.
static constexpr auto MAX_TRACKED_SUBMISSIONS = 50u;
+ static constexpr auto MAX_TRACKED_PRESENT_IDS = 50u;
public:
DeviceContext& device;
@@ -79,6 +80,13 @@ class QueueContext final : public Context {
using present_id_t = std::uint64_t;
std::unordered_map<present_id_t, submissions_t> unpresented_submissions;
+ // We might be tracking present_ids which aren't presented to - and as a
+ // result we don't ever clear those Submissions. So manually evict them by
+ // removing the n'th oldest. This is elegant because even if our
+ // SwapchainMonitor has these stored (unlikely) they won't be destructed as
+ // it just decrements their std::shared_ptr use count.
+ std::deque<present_id_t> present_id_ring;
+
public:
QueueContext(DeviceContext& device_context, const VkQueue& queue,
const std::uint32_t& queue_family_index);