aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.hh
diff options
context:
space:
mode:
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);