From 85573fdb740d4c1a25cdeb5d81cf4c522c62057c Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sun, 7 Jul 2024 16:10:22 +0200 Subject: [PATCH 1/3] call batchFinishedCallback later to prevent timeouts on unhandled rejections --- 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 1b9815117f89..ee1f362dd0fc 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); + void 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); From 1a5648e562c8438c65c5d7837c78eb42803c3c79 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sat, 13 Jul 2024 07:13:48 +0200 Subject: [PATCH 2/3] await onSubmittedWorkDone Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- src/webgpu/shader/execution/expression/expression.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webgpu/shader/execution/expression/expression.ts b/src/webgpu/shader/execution/expression/expression.ts index ee1f362dd0fc..21d5b235778e 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(); + void (await t.queue.onSubmittedWorkDone()); }; const pendingBatches = []; From 894ad5e6a9040cee92a76fcc3bafa59c52aec02c Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Mon, 15 Jul 2024 10:52:54 -0700 Subject: [PATCH 3/3] Remove unnecessary void operator --- src/webgpu/shader/execution/expression/expression.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webgpu/shader/execution/expression/expression.ts b/src/webgpu/shader/execution/expression/expression.ts index 21d5b235778e..a609b4b73df4 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 (await t.queue.onSubmittedWorkDone()); + await t.queue.onSubmittedWorkDone(); }; const pendingBatches = [];