yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

buffer_cache: Delay buffer destructions

Delay buffer destruction some extra frames to avoid destroying buffers
that are still being used from older frames. This happens on Nvidia's
driver with mailbox.
This commit is contained in:
ReinUsesLisp 2020-01-21 16:27:43 -03:00
parent b11aeced18
commit b35449c85d
1 changed files with 4 additions and 1 deletions

View File

@ -101,7 +101,10 @@ public:
void TickFrame() { void TickFrame() {
++epoch; ++epoch;
while (!pending_destruction.empty()) { while (!pending_destruction.empty()) {
if (pending_destruction.front()->GetEpoch() + 1 > epoch) { // Delay at least 4 frames before destruction.
// This is due to triple buffering happening on some drivers.
static constexpr u64 epochs_to_destroy = 5;
if (pending_destruction.front()->GetEpoch() + epochs_to_destroy > epoch) {
break; break;
} }
pending_destruction.pop_front(); pending_destruction.pop_front();