mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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:
parent
f42f708f72
commit
820904f22d
@ -131,8 +131,8 @@ namespace dxvk {
|
|||||||
* the device can guarantee that the submission has
|
* the device can guarantee that the submission has
|
||||||
* completed.
|
* completed.
|
||||||
*/
|
*/
|
||||||
void trackResource(const Rc<DxvkResource>& rc) {
|
void trackResource(Rc<DxvkResource> rc) {
|
||||||
m_resources.trackResource(rc);
|
m_resources.trackResource(std::move(rc));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,9 +25,9 @@ namespace dxvk {
|
|||||||
* \brief Adds a resource to track
|
* \brief Adds a resource to track
|
||||||
* \param [in] rc The resource to track
|
* \param [in] rc The resource to track
|
||||||
*/
|
*/
|
||||||
void trackResource(const Rc<DxvkResource>& rc) {
|
void trackResource(Rc<DxvkResource>&& rc) {
|
||||||
m_resources.push_back(rc);
|
|
||||||
rc->acquire();
|
rc->acquire();
|
||||||
|
m_resources.emplace_back(std::move(rc));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user