mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-21 21:05:56 +00:00
Wake the completion thread for a new callback only when its value is already reached: the replay's callbacks wait for the submission it records, whose submit wakes the thread anyway
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bcbbcb0b1a
commit
895aa43ab9
1 file changed
+3
-1
+3
-1
@@ -381,7 +381,9 @@ void vk_completion_add(uint64_t fence, void (*fn)(void *), void *arg) {
|
||||
}
|
||||
}
|
||||
queue[qhead + qn++] = (Pending){fence, fn, arg};
|
||||
WakeAllConditionVariable(&cv_work);
|
||||
// The completion thread sleeps only while nothing is issued beyond done: a callback for a later value (the replay's,
|
||||
// for the submission it records: counter reports, freed resources) becomes due through the submit, which wakes it.
|
||||
if (fence <= done) WakeAllConditionVariable(&cv_work);
|
||||
ReleaseSRWLockExclusive(&st_lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user