From 518ba58acdce4e38c28dd9a78e4476073f61f6af Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Wed, 17 Jul 2024 07:10:48 +0200 Subject: [PATCH] Catch and fail GPUPipelineError Co-authored-by: Brandon Jones Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- src/webgpu/shader/execution/expression/expression.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/webgpu/shader/execution/expression/expression.ts b/src/webgpu/shader/execution/expression/expression.ts index f486723baf56..e50767601750 100644 --- a/src/webgpu/shader/execution/expression/expression.ts +++ b/src/webgpu/shader/execution/expression/expression.ts @@ -430,7 +430,17 @@ export async function run( } batchesInFlight += 1; - pendingBatches.push(processBatch(batchCases).finally(batchFinishedCallback)); + pendingBatches.push( + processBatch(batchCases) + .catch(err => { + if (err instanceof GPUPipelineError) { + t.fail(`Pipeline Creation Error, ${err.reason}: ${err.message}`); + } else { + throw err; + } + }) + .finally(batchFinishedCallback) + ); } await Promise.all(pendingBatches);