Skip to content

Commit

Permalink
fix worker check
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Feb 2, 2024
1 parent 1778687 commit 8947008
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions worker.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Expand Down

0 comments on commit 8947008

Please sign in to comment.