Change DescriptorSetAllocator destruction order

During TickImpl() DescriptorSetAllocators were destroyed by calling
mDescriptorAllocatorsPendingDeallocation->ClearUpTo() after
GetFencedDeleter()->Tick(). Change the order so
mDescriptorAllocatorsPendingDeallocation operations happen at the same
time.

Change-Id: I41af35f50b87c1a1defda5fb334b0c497c670d05
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/215054
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@google.com>
diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp
index 2e6d2dc..5c3df42 100644
--- a/src/dawn/native/vulkan/DeviceVk.cpp
+++ b/src/dawn/native/vulkan/DeviceVk.cpp
@@ -336,10 +336,10 @@
          mDescriptorAllocatorsPendingDeallocation.IterateUpTo(completedSerial)) {
         allocator->FinishDeallocation(completedSerial);
     }
+    mDescriptorAllocatorsPendingDeallocation.ClearUpTo(completedSerial);
 
     GetResourceMemoryAllocator()->Tick(completedSerial);
     GetFencedDeleter()->Tick(completedSerial);
-    mDescriptorAllocatorsPendingDeallocation.ClearUpTo(completedSerial);
 
     DAWN_TRY(queue->SubmitPendingCommands());
     DAWN_TRY(CheckDebugLayerAndGenerateErrors());
@@ -912,11 +912,11 @@
          mDescriptorAllocatorsPendingDeallocation.IterateUpTo(kMaxExecutionSerial)) {
         allocator->FinishDeallocation(kMaxExecutionSerial);
     }
+    mDescriptorAllocatorsPendingDeallocation.ClearUpTo(kMaxExecutionSerial);
 
     // Releasing the uploader enqueues buffers to be released.
     // Call Tick() again to clear them before releasing the deleter.
     GetResourceMemoryAllocator()->Tick(kMaxExecutionSerial);
-    mDescriptorAllocatorsPendingDeallocation.ClearUpTo(kMaxExecutionSerial);
 
     // Allow recycled memory to be deleted.
     GetResourceMemoryAllocator()->DestroyPool();