aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.cc
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-04-01 00:49:34 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-04-01 00:49:34 +1100
commit31c69428639c0674339c3752c5401542d38693bc (patch)
treee5d215ffbbe6ec0630aaadef6afa218cd6f60a21 /src/queue_context.cc
parentaa3dbff2342a4d698c10a5fd816904de01b03605 (diff)
Turn shared_ptr to unique_ptr in Context, strictly transfer ownership in notify_present
Diffstat (limited to 'src/queue_context.cc')
-rw-r--r--src/queue_context.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/queue_context.cc b/src/queue_context.cc
index e9f9c3c..b4591f8 100644
--- a/src/queue_context.cc
+++ b/src/queue_context.cc
@@ -96,7 +96,7 @@ void QueueContext::notify_submit(
// mapping (might be empty, but handled with operator[]).
auto& submissions = this->unpresented_submissions[present_id];
if (submissions == nullptr) {
- submissions = std::make_shared<Submissions>();
+ submissions = std::make_unique<Submissions>();
if (present_id) {
this->present_id_ring.emplace_back(present_id);
}
@@ -119,10 +119,10 @@ void QueueContext::notify_present(const VkSwapchainKHR& swapchain,
// We're avoiding a double hash here - don't use operator[] and erase.
auto iter = this->unpresented_submissions.try_emplace(present_id).first;
if (iter->second == nullptr) {
- iter->second = std::make_shared<Submissions>();
+ iter->second = std::make_unique<Submissions>();
}
- this->device.notify_present(swapchain, iter->second);
+ this->device.notify_present(swapchain, std::move(iter->second));
// Important, we nuke the submission because now it's presented.
this->unpresented_submissions.erase(iter);