diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-04-05 16:59:32 +1000 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-04-05 16:59:32 +1000 |
| commit | 411f7acb1f92db88d2a3c92bb40da2133852b40e (patch) | |
| tree | a37377abea35bb01e6e1074e15e4c1b50f66ccf1 /src/queue_context.cc | |
| parent | 6cae1c14ebdd9d026134212ed8561fb845a11ff6 (diff) | |
Nuke old implementation, silence warnings
Diffstat (limited to 'src/queue_context.cc')
| -rw-r--r-- | src/queue_context.cc | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/queue_context.cc b/src/queue_context.cc index b4591f8..635b593 100644 --- a/src/queue_context.cc +++ b/src/queue_context.cc @@ -43,91 +43,9 @@ QueueContext::QueueContext(DeviceContext& device, const VkQueue& queue, } QueueContext::~QueueContext() { - this->unpresented_submissions.clear(); this->timestamp_pool.reset(); } -QueueContext::Submissions::Submissions() {} - -QueueContext::Submissions::~Submissions() {} - -void QueueContext::Submissions::add_submission( - const std::shared_ptr<TimestampPool::Handle> head, - const std::shared_ptr<TimestampPool::Handle> tail, - const DeviceClock::time_point_t& now) { - - this->submissions.emplace_back(std::make_unique<Submission>(Submission{ - .head_handle = head, - .tail_handle = tail, - .cpu_present_time = now, - })); - - // Manual eviction of likely irrelevant timing information. - if (std::size(this->submissions) > this->MAX_TRACKED_SUBMISSIONS) { - this->submissions.pop_front(); - } -} - -bool QueueContext::Submissions::has_completed() const { - if (this->submissions.empty()) { - return true; - } - - const auto& last_submission = this->submissions.back(); - return last_submission->tail_handle->get_time().has_value(); -} - -void QueueContext::Submissions::await_completed() const { - if (this->submissions.empty()) { - return; - } - - const auto& last_submission = this->submissions.back(); - last_submission->tail_handle->await_time(); -} - -void QueueContext::notify_submit( - const present_id_t& present_id, - const std::shared_ptr<TimestampPool::Handle> head_handle, - const std::shared_ptr<TimestampPool::Handle> tail_handle, - const DeviceClock::time_point_t& now) { - - // Push this submission onto our unpresented_submissions at our present_id - // mapping (might be empty, but handled with operator[]). - auto& submissions = this->unpresented_submissions[present_id]; - if (submissions == nullptr) { - submissions = std::make_unique<Submissions>(); - if (present_id) { - this->present_id_ring.emplace_back(present_id); - } - } - - submissions->add_submission(head_handle, tail_handle, now); - - if (std::size(this->present_id_ring) > MAX_TRACKED_PRESENT_IDS) { - const auto evicted_present_id = this->present_id_ring.front(); - this->present_id_ring.pop_front(); - - this->unpresented_submissions.erase(evicted_present_id); - } -} - -void QueueContext::notify_present(const VkSwapchainKHR& swapchain, - const present_id_t& present_id) { - - // Notify the device that this swapchain was just presented to. - // 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_unique<Submissions>(); - } - - this->device.notify_present(swapchain, std::move(iter->second)); - - // Important, we nuke the submission because now it's presented. - this->unpresented_submissions.erase(iter); -} - bool QueueContext::should_inject_timestamps() const { const auto& physical_device = this->device.physical_device; @@ -142,11 +60,6 @@ bool QueueContext::should_inject_timestamps() const { return false; } - // Don't do it if we've been marked as 'out of band' by nvidia's extension. - if (this->is_out_of_band) { - return false; - } - assert(physical_device.queue_properties); const auto& queue_props = *physical_device.queue_properties; assert(this->queue_family_index < std::size(queue_props)); |
