From 70e5314cc671c2e757f8632f93b75a2fad267192 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 20 Dec 2017 02:45:57 +0100 Subject: [PATCH] [dxvk] Optimized resource tracking Putting all resources that are used by a command list into a vector instead of a hash set is more efficient. --- build-win64.txt | 2 +- src/dxvk/dxvk_lifetime.cpp | 6 ------ src/dxvk/dxvk_lifetime.h | 10 ++++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/build-win64.txt b/build-win64.txt index 63d67d834..cb2eb0eae 100644 --- a/build-win64.txt +++ b/build-win64.txt @@ -9,7 +9,7 @@ exe_wrapper = 'wine' c_args = ['-Og', '-ggdb'] c_link_args = ['-static', '-static-libgcc'] -cpp_args = ['-Og', '-gstabs'] +cpp_args = ['-Og', '-gdwarf'] cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++'] [host_machine] diff --git a/src/dxvk/dxvk_lifetime.cpp b/src/dxvk/dxvk_lifetime.cpp index c99c26def..cc7652ee3 100644 --- a/src/dxvk/dxvk_lifetime.cpp +++ b/src/dxvk/dxvk_lifetime.cpp @@ -6,12 +6,6 @@ namespace dxvk { DxvkLifetimeTracker::~DxvkLifetimeTracker() { } - void DxvkLifetimeTracker::trackResource(const Rc& rc) { - if (m_resources.insert(rc).second) - rc->acquire(); - } - - void DxvkLifetimeTracker::reset() { for (auto i = m_resources.cbegin(); i != m_resources.cend(); i++) (*i)->release(); diff --git a/src/dxvk/dxvk_lifetime.h b/src/dxvk/dxvk_lifetime.h index ebdf2ef86..4534fe4f2 100644 --- a/src/dxvk/dxvk_lifetime.h +++ b/src/dxvk/dxvk_lifetime.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include "dxvk_resource.h" @@ -25,8 +25,10 @@ namespace dxvk { * \brief Adds a resource to track * \param [in] rc The resource to track */ - void trackResource( - const Rc& rc); + void trackResource(const Rc& rc) { + m_resources.push_back(rc); + rc->acquire(); + } /** * \brief Resets the command list @@ -38,7 +40,7 @@ namespace dxvk { private: - std::unordered_set, RcHash> m_resources; + std::vector> m_resources; };