From 20425f60bb00676af386b5c31e7748c0e2cb1702 Mon Sep 17 00:00:00 2001 From: Samson <16504129+sagudev@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:56:59 +0200 Subject: [PATCH] Run batchFinishedCallback on processBatch to catch unhandled rejections by test functions (#3844) --- src/webgpu/shader/execution/expression/expression.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webgpu/shader/execution/expression/expression.ts b/src/webgpu/shader/execution/expression/expression.ts index 29bb8d93674e..f486723baf56 100644 --- a/src/webgpu/shader/execution/expression/expression.ts +++ b/src/webgpu/shader/execution/expression/expression.ts @@ -413,7 +413,7 @@ export async function run( }; const checkBatch = await submitBatch(t, shaderBuilder, shaderBuilderParams, pipelineCache); checkBatch(); - void t.queue.onSubmittedWorkDone().finally(batchFinishedCallback); + await t.queue.onSubmittedWorkDone(); }; const pendingBatches = []; @@ -430,7 +430,7 @@ export async function run( } batchesInFlight += 1; - pendingBatches.push(processBatch(batchCases)); + pendingBatches.push(processBatch(batchCases).finally(batchFinishedCallback)); } await Promise.all(pendingBatches);