Check the availability of free command allocator When testing WebGPU support on Qualcomm, there is a little chance we couldn't get a free allocator. However, it's too hard to reproduce the issue locally. So we use DAWN_CHECK instead of DAWN_ASSERT to see how often we may hit this in the wild. Bug: 442950558 Change-Id: Ib9636de25d7876d08edfff4b58d4f6270f4c1536 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/262254 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Yang Gu <ygu@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
diff --git a/src/dawn/native/d3d12/QueueD3D12.cpp b/src/dawn/native/d3d12/QueueD3D12.cpp index 7c5e60e..5c41cf8 100644 --- a/src/dawn/native/d3d12/QueueD3D12.cpp +++ b/src/dawn/native/d3d12/QueueD3D12.cpp
@@ -237,7 +237,9 @@ DAWN_TRY(RecycleUnusedCommandLists()); } - DAWN_ASSERT(mFreeAllocators.any()); + // This is a release check to catch a potential issue where allocator recycling didn't seem to + // work correctly so we want to get crash reports if it happens again. + DAWN_CHECK(mFreeAllocators.any()); ID3D12Device* d3d12Device = ToBackend(GetDevice())->GetD3D12Device(); // Get the index of the first free allocator from the bitset