mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 23:52:20 +01: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) {
|
||||
if (value <= m_value.load(std::memory_order_acquire))
|
||||
return;
|
||||
|
||||
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
||||
m_cond.wait(lock, [this, value] {
|
||||
return value <= m_value.load(std::memory_order_acquire);
|
||||
@ -129,6 +132,9 @@ namespace dxvk::sync {
|
||||
}
|
||||
|
||||
void wait(uint64_t value) {
|
||||
if (value <= m_value.load(std::memory_order_acquire))
|
||||
return;
|
||||
|
||||
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
||||
m_cond.wait(lock, [this, value] {
|
||||
return value <= m_value.load(std::memory_order_acquire);
|
||||
|
Loading…
x
Reference in New Issue
Block a user