1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 02:52:10 +01:00

[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.
This commit is contained in:
Philip Rebohle 2017-12-20 02:45:57 +01:00
parent d2b676b551
commit 70e5314cc6
3 changed files with 7 additions and 11 deletions

View File

@ -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]

View File

@ -6,12 +6,6 @@ namespace dxvk {
DxvkLifetimeTracker::~DxvkLifetimeTracker() { }
void DxvkLifetimeTracker::trackResource(const Rc<DxvkResource>& 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();

View File

@ -1,6 +1,6 @@
#pragma once
#include <unordered_set>
#include <vector>
#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<DxvkResource>& rc);
void trackResource(const Rc<DxvkResource>& rc) {
m_resources.push_back(rc);
rc->acquire();
}
/**
* \brief Resets the command list
@ -38,7 +40,7 @@ namespace dxvk {
private:
std::unordered_set<Rc<DxvkResource>, RcHash<DxvkResource>> m_resources;
std::vector<Rc<DxvkResource>> m_resources;
};