From 89470087a86b76806cf94c9680f75d9d52649078 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Thu, 1 Feb 2024 17:49:43 -0800 Subject: [PATCH] fix worker check --- worker.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worker.js b/worker.js index a605f04..378a4f0 100644 --- a/worker.js +++ b/worker.js @@ -1,4 +1,4 @@ -async function createWebGPUDevice(adapterDesc, results) { +async function createWebGPUDevice(data, adapterDesc, results) { const adapter = await navigator.gpu.requestAdapter(adapterDesc); if (adapter) { results.adapter = true; @@ -20,15 +20,16 @@ async function checkWebGPU(id, data) { } try { - createWebGPUDevice({}, results); + await createWebGPUDevice(data, {}, results); } catch (e) { results.error = (e.message || e).toString(); } if (!results.adapter) { try { - createWebGPUDevice({compatibilityMode: true}, results); + await createWebGPUDevice(data, {compatibilityMode: true}, results); results.compat = true; + delete results.error; } catch (e) { results.error = (e.message || e).toString(); }