diff --git a/src/gallium/drivers/d3d12/d3d12_residency.cpp b/src/gallium/drivers/d3d12/d3d12_residency.cpp index c00e55e4014..f586522e4c5 100644 --- a/src/gallium/drivers/d3d12/d3d12_residency.cpp +++ b/src/gallium/drivers/d3d12/d3d12_residency.cpp @@ -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; } }