1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[dxvk] Optimize ref counting around resource tracking

Micro-optimization that reduces the number of atomic increments
and decrements when moving reference-counted objects around.
This commit is contained in:
Philip Rebohle 2018-09-17 20:42:08 +02:00
parent f42f708f72
commit 820904f22d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 4 additions and 4 deletions

View File

@ -131,8 +131,8 @@ namespace dxvk {
* the device can guarantee that the submission has
* completed.
*/
void trackResource(const Rc<DxvkResource>& rc) {
m_resources.trackResource(rc);
void trackResource(Rc<DxvkResource> rc) {
m_resources.trackResource(std::move(rc));
}
/**

View File

@ -25,9 +25,9 @@ namespace dxvk {
* \brief Adds a resource to track
* \param [in] rc The resource to track
*/
void trackResource(const Rc<DxvkResource>& rc) {
m_resources.push_back(rc);
void trackResource(Rc<DxvkResource>&& rc) {
rc->acquire();
m_resources.emplace_back(std::move(rc));
}
/**