From 9215cfdcf2619098efee860c116d867afa1e3b86 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 22 Mar 2018 11:01:54 +0100 Subject: [PATCH] [dxvk] Minor --- src/dxvk/dxvk_lifetime.cpp | 4 ++-- src/dxvk/dxvk_queue.cpp | 7 +++---- src/dxvk/dxvk_resource.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dxvk/dxvk_lifetime.cpp b/src/dxvk/dxvk_lifetime.cpp index cc7652ee..3d03f523 100644 --- a/src/dxvk/dxvk_lifetime.cpp +++ b/src/dxvk/dxvk_lifetime.cpp @@ -7,8 +7,8 @@ namespace dxvk { void DxvkLifetimeTracker::reset() { - for (auto i = m_resources.cbegin(); i != m_resources.cend(); i++) - (*i)->release(); + for (const auto& resource : m_resources) + resource->release(); m_resources.clear(); } diff --git a/src/dxvk/dxvk_queue.cpp b/src/dxvk/dxvk_queue.cpp index 8ab6f8ca..49d02693 100644 --- a/src/dxvk/dxvk_queue.cpp +++ b/src/dxvk/dxvk_queue.cpp @@ -30,9 +30,8 @@ namespace dxvk { }); m_entries.push({ fence, cmdList }); + m_condOnAdd.notify_one(); } - - m_condOnAdd.notify_one(); } @@ -50,10 +49,10 @@ namespace dxvk { entry = std::move(m_entries.front()); m_entries.pop(); } + + m_condOnTake.notify_one(); } - m_condOnTake.notify_one(); - if (entry.fence != nullptr) { while (!entry.fence->wait(1'000'000'000ull)) continue; diff --git a/src/dxvk/dxvk_resource.h b/src/dxvk/dxvk_resource.h index 38b0a97a..bb69924d 100644 --- a/src/dxvk/dxvk_resource.h +++ b/src/dxvk/dxvk_resource.h @@ -25,7 +25,7 @@ namespace dxvk { virtual ~DxvkResource(); bool isInUse() const { - return m_useCount != 0; + return m_useCount.load() != 0; } void acquire() { m_useCount += 1; }