Skip to content

Commit 518ba58

Browse files
sagudevtoji
andcommitted
Catch and fail GPUPipelineError
Co-authored-by: Brandon Jones <[email protected]> Signed-off-by: sagudev <[email protected]>
1 parent 20425f6 commit 518ba58

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/webgpu/shader/execution/expression/expression.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,17 @@ export async function run(
430430
}
431431
batchesInFlight += 1;
432432

433-
pendingBatches.push(processBatch(batchCases).finally(batchFinishedCallback));
433+
pendingBatches.push(
434+
processBatch(batchCases)
435+
.catch(err => {
436+
if (err instanceof GPUPipelineError) {
437+
t.fail(`Pipeline Creation Error, ${err.reason}: ${err.message}`);
438+
} else {
439+
throw err;
440+
}
441+
})
442+
.finally(batchFinishedCallback)
443+
);
434444
}
435445

436446
await Promise.all(pendingBatches);

0 commit comments

Comments
 (0)