mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-04-06 00:57:40 +02:00
[util] Avoid locking fence objects on wait if target value was reached
This commit is contained in:
parent
bdec26b442
commit
0249193403
@ -78,6 +78,9 @@ namespace dxvk::sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wait(uint64_t value) {
|
void wait(uint64_t value) {
|
||||||
|
if (value <= m_value.load(std::memory_order_acquire))
|
||||||
|
return;
|
||||||
|
|
||||||
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
||||||
m_cond.wait(lock, [this, value] {
|
m_cond.wait(lock, [this, value] {
|
||||||
return value <= m_value.load(std::memory_order_acquire);
|
return value <= m_value.load(std::memory_order_acquire);
|
||||||
@ -129,6 +132,9 @@ namespace dxvk::sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wait(uint64_t value) {
|
void wait(uint64_t value) {
|
||||||
|
if (value <= m_value.load(std::memory_order_acquire))
|
||||||
|
return;
|
||||||
|
|
||||||
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
||||||
m_cond.wait(lock, [this, value] {
|
m_cond.wait(lock, [this, value] {
|
||||||
return value <= m_value.load(std::memory_order_acquire);
|
return value <= m_value.load(std::memory_order_acquire);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user