d3d12: Minor fixes to residency algorithm when eviction is needed

Always reset batch_count and batch_memory_size. Proceed to eviction
only if we stopped before filling up the batch.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34562>
This commit is contained in:
Jesse Natalie 2025-04-16 12:46:49 -07:00 committed by Marge Bot
parent 565980f3c0
commit 37e6a8b57f

View file

@ -228,10 +228,13 @@ d3d12_process_batch_residency(struct d3d12_screen *screen, struct d3d12_batch *b
++screen->residency_fence_value;
}
if (SUCCEEDED(hr) && batch_count == residency_batch_size) {
if (SUCCEEDED(hr)) {
bool batch_full = batch_count == residency_batch_size;
batch_count = 0;
size_to_make_resident -= batch_memory_size;
continue;
batch_memory_size = 0;
if (batch_full)
continue;
}
}